sum a column based on 3 other criteria match

myduki

New Member
Joined
Mar 20, 2018
Messages
7
Hi!
I have a table where I have 4 columns (3 criteria and 1 value to sum if the criteria are meet), but I need that the value only sums at the end of the match (so it will only be shown ones that are "true" and empty when false)

criteria 1criteria 2criteria 3values to sumwishing for:
AAlphaBlue2
AAlphaBlue35
ABetaBlue5
ABetaBlue914
ABetaGreen88
BDeltaGreen7
BDeltaGreen613
BAlphaYellow1010
CAlphaBlue11
CAlphaBlue112

<tbody>
</tbody>

I have tried this (but is sums up in every cell, and I need it to be empty when it repeats and only show the value ONCE):
=IF(AND(COUNTIF(B$2:B390;B218)=COUNTIF(B:B;B218);COUNTIF(T$2:T390;T218)=COUNTIF(T$2:T390;T218);COUNTIF(U$2:U390;U218)=COUNTIF(U$2:U390;U218));SUMIFS(V:V;B:B;B218;T:T;T218;U:U;U218);" ")

Can somebody help? (I need a formula, not pivot table)
Thanks!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi. See if this works:

=IF(AND(B2=B3,T2=T3,U2=U3),"",SUMIFS($V$2:V2,$B$2:B2,B2,$T$2:T2,T2,$U$2:U2,U2))

Change the ranges to suit.
 
Upvote 0
Try this

ABCDEFG
1criteria 1criteria 2criteria 3Helper Columnvalues to sumwishing for:Formula
2AAlphaBlueAAlphaBlue2
3AAlphaBlueAAlphaBlue355
4ABetaBlueABetaBlue5
5ABetaBlueABetaBlue91414
6ABetaGreenABetaGreen888
7BDeltaGreenBDeltaGreen7
8BDeltaGreenBDeltaGreen61313
9BAlphaYellowBAlphaYellow101010
10CAlphaBlueCAlphaBlue11
11CAlphaBlueCAlphaBlue11212

<colgroup><col style="width: 25pxpx" https:="" www.mrexcel.com="" forum="" usertag.php?do="list&action=hash&hash=DAE7F5"" target="_blank"></colgroup><colgroup><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>

CellFormula
G2=IF(COUNTIF($D$2:$D$11,D2)=COUNTIF($D$2:$D2,D2),SUMIF($D$2:$D$11,D2,$E$2:$E$11),"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hi,
thanks but this only works if all the data is perfectly order (and it is not). I changed the list for a better view on my problem:

criteria 1criteria 2criteria 3values to sum[FONT=&quot]wishing for:[/FONT]
AAlphaBlue2
AAlphaBlue3
ABetaBlue5
ABetaBlue914
AAlphaBlue813
BDeltaGreen7
BDeltaGreen613
BAlphaYellow1010
CAlphaBlue11
CAlphaBlue112

<tbody>
</tbody>
 
Upvote 0
Try solution I gave you. It doesn't care about order and add value to the last entry for the set
 
Upvote 0
Heres a couple of ways:

=IF(COUNTIFS($B$2:B2,B2,$T$2:T2,T2,$U$2:U2,U2)=COUNTIFS(B:B,B2,T:T,T2,U:U,U2),SUMIFS($V$2:V2,$B$2:B2,B2,$T$2:T2,T2,$U$2:U2,U2),"")
=IF(ROW()=LOOKUP(2,1/((B:B=B2)*(T:T=T2)*(U:U=U2)),ROW(B:B)),SUMIFS($V$2:V2,$B$2:B2,B2,$T$2:T2,T2,$U$2:U2,U2),"")
 
Upvote 0
Try solution I gave you. It doesn't care about order and add value to the last entry for the set

Actually this did worked! (I must have had a typo while converting it to my table then)

Thanks a million! to everybody for your ideas as well!
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

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