SUMIF with double conditional

Growlithe

New Member
Joined
Sep 11, 2017
Messages
1
Hey everybody,

I've been racking my brain around this for a few hours now and just cant seem to come up with the answer, was hoping someone here may have a better idea than me.

Essentially, I have a database where I need to SUM a range IF the criteria in two cells of two columns are met, however these are variable.

Example below:


[TABLE="width: 884"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 884"]
<tbody>[TR]
[TD]First name[/TD]
[TD]Last Name[/TD]
[TD] Irrelevant[/TD]
[TD]Individual Value[/TD]
[TD]Irrelevant[/TD]
[TD]Irrelevant[/TD]
[TD]Irrelevant details[/TD]
[/TR]
[TR]
[TD]ABCD[/TD]
[TD]WZYZ[/TD]
[TD="align: right"]918[/TD]
[TD="align: right"]1275[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ABCD[/TD]
[TD]WZYZ[/TD]
[TD="align: right"]2090[/TD]
[TD="align: right"]7434[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ABCD[/TD]
[TD]WZYZ[/TD]
[TD="align: right"]1982[/TD]
[TD="align: right"]14440[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ERTY[/TD]
[TD]KJHG[/TD]
[TD="align: right"]2458[/TD]
[TD="align: right"]10017[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTY[/TD]
[TD]KJHG[/TD]
[TD="align: right"]1691[/TD]
[TD="align: right"]6622[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTY[/TD]
[TD]KJHG[/TD]
[TD="align: right"]479[/TD]
[TD="align: right"]13841[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]355[/TD]
[TD="align: right"]13947[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]1245[/TD]
[TD="align: right"]6083[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]1877[/TD]
[TD="align: right"]14466[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]2150[/TD]
[TD="align: right"]1476[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]1498[/TD]
[TD="align: right"]1024[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]2931[/TD]
[TD="align: right"]15999[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]2613[/TD]
[TD="align: right"]1091[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]246[/TD]
[TD="align: right"]10351[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]VBNK[/TD]
[TD]FGHJ[/TD]
[TD="align: right"]1857[/TD]
[TD="align: right"]3900[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]900[/TD]
[TD="align: right"]5565[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]1754[/TD]
[TD="align: right"]12680[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]302[/TD]
[TD="align: right"]8749[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]2262[/TD]
[TD="align: right"]1590[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]2237[/TD]
[TD="align: right"]13887[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]1533[/TD]
[TD="align: right"]14075[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
[TR]
[TD]ERTYU[/TD]
[TD]THJM[/TD]
[TD="align: right"]2378[/TD]
[TD="align: right"]1904[/TD]
[TD]date here[/TD]
[TD]date here[/TD]
[TD]Details 12345678910[/TD]
[/TR]
</tbody>[/TABLE]


So, essentially, I need to SUM G each time the corresponding A and or B changes value.
So here Id SUM G2:4 and then 6:8 etc...
Just to make things that bit more difficult the first and last names here will pop up again in random combinations with each and others further down the list.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
G doesn't actually contain "summable" data, so I assumed that was dummy/sample data?

Try this, it will create a running total by name...
H2=IF(A2="","",SUMIFS($G$2:G2,$A$2:A2,A2,$B$2:B2,B2))
copied down
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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