Sum if offset cell equals particular value

jbenfleming

New Member
Joined
Mar 30, 2017
Messages
34
So lets say i have two columns. One with names (John and Jane) and one with values. What is a formula I could input in B5 and B6 (John and Jane respectively) that would show the sum for each person. For instance the formula in B5 would return 2 and B6 would return -2. The list I'm using will have rows added regularly. I know that I could use VBA but I would rather not.

JOHN1
JANE-1
JANE-1
JOHN1
TOTAL JOHN
TOTAL JANE

<tbody>
</tbody>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
ok, try this


Excel 2013/2016
AB
1JOHN1
2JANE-1
3JANE-1
4JOHN1
5JANE1
6JOHN1
7JANE5
8JOHN3
9JANE2
10JOHN5
11JANE3
12JOHN3
13JOHN2
14JANE1
15JOHN3
16TOTAL
17JOHN16
18JANE10
Sheet3
Cell Formulas
RangeFormula
B17=SUMIF(INDIRECT("$A$1:$A$"&MATCH("TOTAL",A:A,0)-2),A17,INDIRECT("$B$1:$B$"&MATCH("TOTAL",A:A,0)-2))
 
Upvote 0
One question, shouldn't the match functions have "-1" at the end rather than "-2"? Otherwise you are omitting the last row of data (John 3, in this case)
 
Upvote 0
I don't see why you need the complex formula, a simple sumif(a1:a15,a17,b1:b15) should work?
 
Upvote 0
Lol, yup. That is much better. Thank you. I'm used to doing everything with VBA so I have an admittedly poor skill set with in sheet formulas. Getting better though.
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,542
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top