Complex sumifs formula with multiple criteria

korhan

Board Regular
Joined
Nov 6, 2009
Messages
215
Hi everyone,

I am trying to implement a count formula using sumifs but I couldn't wrap my head around it.
I want to be able to count member depending on the code column. Anything less than or equal 3. Also, date will be another criteria.
Trickiest part is amount will be a criteria for counting the member. If the amount is negative, count member as negative and if positive just count ( add) as positive.
Any ideas?
DateCodeMemberAmount
1/1/2017

<tbody>
</tbody>
112$200
1/1/2017

<tbody>
</tbody>
12$100
1/1/2017

<tbody>
</tbody>
1123-$50
1/1/2017

<tbody>
</tbody>
35-$20
1/1/2017

<tbody>
</tbody>
16$25
1/1/2017

<tbody>
</tbody>
47-$100
2/1/2017

<tbody>
</tbody>
38$55
2/1/2017

<tbody>
</tbody>
26$23
2/1/2017

<tbody>
</tbody>
16$42
2/1/2017

<tbody>
</tbody>
19-$25
2/1/2017

<tbody>
</tbody>
510$25
2/1/2017

<tbody>
</tbody>
39$23

<tbody>
</tbody>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
These are just random numbers.
It is just a number. Think of it like you are counting a member for how many times they visited your store.
 
Last edited:
Upvote 0
So if I am understanding it correctly, Member number 6 for 02/01/2017 should give a count of 2 , whereas member number 9 for the same date should give a count of 0?
 
Upvote 0
Look at it this way, on 02/01/2017 counting the member visits, I should get 30.
If the $ amount is negative count that visit as negative.
8 + 6 + 6 - 9 + 10 + 9.
Most of these visits left positive $ amounts so count them as positive. There is only one negative amount so subtract that from the total visits.
 
Upvote 0
should you not get 20 as the entry associated with 10 has a code of 5 which is > 3
 
Upvote 0
Yes, you are right. I have missed that. It should be 20.
Thanks for correcting me.
 
Upvote 0
can you check if this does what you Want?


Excel 2013/2016
ABCDEFG
1DateCodeMemberAmount
201/01/201711220002/01/201720
301/01/201712100
401/01/20171123-50
501/01/201735-20
601/01/20171625
701/01/201747-100
802/01/20173855
902/01/20172623
1002/01/20171642
1102/01/201719-25
1202/01/201751025
1302/01/20173923
Sheet3
Cell Formulas
RangeFormula
G2=SUMPRODUCT(SUMIFS($C$2:$C$13,$A$2:$A$13,F2,$B$2:$B$13,"<4",$D$2:$D$13,{"<0",">0"}),{-1,1})
 
Upvote 0
Yes, that does it. Thanks a lot.
Couple of questions, how were you able to neatly copy paste your table into here?
Secondly, can you give a brief explanation on how this formula is able to do what I wanted.
I appreciate your time.
 
Upvote 0
how were you able to neatly copy paste your table into here?

download mrExcel HTML Maker:
https://onedrive.live.com/?id=8CFFDEC0CE27E813!189&cid=8CFFDEC0CE27E813

can you give a brief explanation on how this formula is able to do what I wanted
it is a simple sumif formula but that uses an array as a last argument to return in an array those with condition less than 0 and those more than 0. then sumproduct will multiply those less than 0 by -1 and those above 0 by 1 and sum them together, in fact doing a subtraction
 
Upvote 0

Forum statistics

Threads
1,214,619
Messages
6,120,550
Members
448,970
Latest member
kennimack

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