Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Iterable Sum over row in google sheets?

I have data in google sheets, looking like this:

A B C D E F G
TP 14656 18885 14317 19312 13303 14311
FN 12216 20107 14066 16323 11180 3478

and I want to implement the following formula:

formula

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

which would manually look like this:

=(B1/(B1+B2))+(C1/(C1+C2))+...+(G1/(G1/G2))

However, I need this formula to be scalable. I’ve tried to use ARRAYFORMULA and SERIESSUM but could not manage to actually iterate over the row. Does sheets even support this, and if so, how does sheets implement iterating sums?

>Solution :

You can do the following:

=Sum(ArrayFormula(B1:G1/(B1:G1+B2:G2)))

Update:

If you want the range to be dependent on a manually entered j, use:

=Sum(ArrayFormula(Indirect("R1C2:"&"R1C"&j+1,0)/(Indirect("R1C2:"&"R1C"&j+1,0)+Indirect("R2C2:"&"R2C"&j+1,0))))

This assumes that the table in your post starts in A1 (R1C1).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading