Forum Discussion
Sami58
Aug 09, 2022Copper Contributor
Which function to use to sum products of specific cells in a row
What function or way to calculate the sum of the *product of one cell by the very next cell and then the following cell by its very next cell &* so on .. all in the same row ?? .. (up to a max spec...
SergeiBaklan
Aug 09, 2022Diamond Contributor
As variant
=SUMPRODUCT(
INDEX(L4:Y4, COLUMN( A1:INDEX( 1:1, COLUMNS(L4:Y4) ) )*2 ),
INDEX(L4:Y4, COLUMN( A1:INDEX( 1:1, COLUMNS(L4:Y4) ) )*2 -1 )
)SergeiBaklan
Aug 16, 2022Diamond Contributor
It doesn't matter what is in A1, that is to generate column numbers in the range. That works like
=SUMPRODUCT(
INDEX(L4:U4, COLUMN( A1:INDEX( 1:1, COLUMNS(L4:U4)/2 ) )*2 ),
INDEX(L4:U4, COLUMN( A1:INDEX( 1:1, COLUMNS(L4:U4)/2 ) )*2 -1 )
)
It was misprint in previous variant, sorry.