Search
Articles
FAQs
Login
All Questions
New Question
Microsoft Excel - Sum Based on Cell Value
-
Asked By
Rajender Prasad
on 25-Sep-13 05:35 AM
hi All,
Small help needed:
I have below data in cells. And I have the number 2 at last, based on this last value, I would need the sum of left side of this number I mean, 9 + 9 = 18 should be the output.
If the last value is 3 then it should be 9+9+8=26 is the output like this..
4
1
7
8
9
9
2
Harry Boughen
replied to
Rajender Prasad
on 25-Sep-13 03:45 PM
Hello Prasad
=SUM(OFFSET(F1,0,0,1,-J1))
With your last number in F1 and your count number in J1 this formula will do it for you.
Regards
Harry
Harry Boughen
replied to
Rajender Prasad
on 25-Sep-13 04:06 PM
Hello again Prasad,
If you want it to be a bit more flexible use this:
=SUM(OFFSET(OFFSET(A1,0, COUNT(A1:I1)-1),0,0,1,-J1))
Regards
Harry
Rajender Prasad
replied to
Harry Boughen
on 25-Sep-13 05:27 PM
Thanks a lot..its working :)