Search code examples
excelexcel-formula

Sum of squares in one Excel cell


Let's say we want this in a Excel cell:

= (B10-A1)^2
 +(C10-A1)^2
 +(D10-A1)^2
 +...
 +(FG10-A1)^2

Is there a way to make such a sum in one cell, without using other intermediary cells for the calculation, and without VBA, just with built-in Excel functions?


Solution

  • It's what SUMSQ() is meant to do I suppose:

    =SUMSQ(B10:FG10-A1)
    

    Confirm through CtrlShiftEnter if working on an older Excel version prior to dynamic array functionality.