Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel sum with relative positions

Tags:

excel

How do I sum from whats in B2 to C2 ?

B2 = A10 or just 10 (preferred)
C2 = A25 or just 25 (preferred)

Normally you would just use SUM(A10:A25), but the values in B2 and C2 are not fixed, they change based on input. I can use MATCH to find the numbers, but how do I tell SUM to use those numbers ? The values to sum are always in the same column.

like image 239
Kim Avatar asked Nov 24 '25 06:11

Kim


1 Answers

You can use the INDIRECT function for this, e.g.

=SUM(INDIRECT(B2):INDIRECT(C2)) 

if you can live with entering the entire cell name (A10, A25).

Or to just have the numbers in B2 and C2, you could use

=SUM(INDIRECT(ADDRESS(B2;1)):INDIRECT(ADDRESS(C2;1)))

(Hope I got the columns and rows in the right order!)

like image 141
Makis Avatar answered Nov 27 '25 23:11

Makis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!