countifs/sumifs Issue.

natesteiner21

New Member
Joined
Jul 10, 2012
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I have a worksheet that has ten columns. We'll call them A-J. I have set up a formula to count a/b, a/c, a/d, a/e and determine which ones meet the criteria that I've set up. Say it counts if there is an "x" in the rows. My issue is that I want to be able to check it for a/b, a/c, a/d, a/e, etc... and a/b/c, a/b/d, a/b/e, etc... and a/b/c/d, a/b/c/e, etc...

I've got the forumulas set up to do that but I'm doing something wrong because it is duplicating the data. i.e. if the row has an "x" in it for column a, b, c it counts it in a/b, a/c, b/c, and a/b/c. I only want it to count in the a/b/c area.

Same exact thing for f-j but using sumifs.

Any help out there? I can post the sheet if you would like.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. Please use XL2BB to post your response. Directions for its use are in my signature.
 
Upvote 0
Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. Please use XL2BB to post your response. Directions for its use are in my signature.
Action Analysis_Template.xlsx
GHIJKLMNOPQRSTU
1SharpW/LBig MoneyW/LPro SystemsW/LModelW/LExpertsW/LW/L
25$0.005$0.005$0.004$0.003$0.00$0.00Sh/BM30
3x x  x   Sh/PS20
4 x x    Sh/Mo30
5x x x x x  Sh/Ex20
6   x   BM/PS30
7x x   x  BM/Mo20
8  x    BM/Ex30
9x  x    PS/Mo10
10 x x  x  PS/Ex20
11x   x   Mo/Ex10
12      Sh/BM/PS10
13      Sh/BM/Mo20
14      Sh/BM/Ex20
15      Sh/PS/Mo10
16      Sh/PS/Ex10
17      Sh/Mo/Ex10
18      BM/PS/Mo10
31
Cell Formulas
RangeFormula
G2,O2,M2,K2,I2G2=COUNTIF(G3:G100,"x")
P2:Q2,N2,L2,J2,H2P2=SUM(P3:P100)
P3:P18,N3:N18,L3:L18,J3:J18,H3:H18P3=IF(OR(ISBLANK($B3),ISBLANK($C3)),"",IF(AND($E3="Spread",(($B3-$C3)+$F3)>0.1,O3="x"),10,IF(AND($E3="Spread",(($B3-$C3)+$F3)<-0.1,O3="x"),-11,IF(AND($E3="Spread",(($B3-$C3)+$F3)=0,O3="x"),0,IF(AND($E3="Over",(($B3+$C3)>$F3),O3="x"),10,IF(AND($E3="Over",(($B3+$C3<$F3)),O3="x"),-11,IF(AND($E3="Over",(($B3+$C3=$F3)),O3="x"),0,IF(AND($E3="Under",(($B3+$C3)<$F3),O3="x"),10,IF(AND($E3="Under",(($B3+$C3>$F3)),O3="x"),-11,IF(AND($E3="Under",(($B3+$C3=$F3)),O3="x"),0,))))))))))
Q3:Q18Q3=IF(OR(ISBLANK($B3),ISBLANK($C3)),"",IF(AND($E3="Spread",(($B3-$C3)+$F3)>0.1),10,IF(AND($E3="Spread",(($B3-$C3)+$F3)<-0.1),-11,IF(AND($E3="Spread",(($B3-$C3)+$F3)=0),0,IF(AND($E3="Over",(($B3+$C3)>$F3)),10,IF(AND($E3="Over",(($B3+$C3<$F3))),-11,IF(AND($E3="Over",(($B3+$C3=$F3))),0,IF(AND($E3="Under",(($B3+$C3)<$F3)),10,IF(AND($E3="Under",(($B3+$C3>$F3))),-11,IF(AND($E3="Under",(($B3+$C3=$F3))),0,))))))))))
T2T2=COUNTIFS(G$2:G$100,"x",I$2:I$100,"x")
U2U2=SUMIFS(H$2:H$100,G$2:G$100,"x",I$2:I$100,"x")
T3T3=COUNTIFS(G$2:G$100,"x",K$2:K$100,"x")
U3U3=SUMIFS(H$2:H$100,G$2:G$100,"x",K$2:K$100,"x")
T4T4=COUNTIFS(G$2:G$100,"x",M$2:M$100,"x")
U4U4=SUMIFS(H$2:H$100,G$2:G$100,"x",M$2:M$100,"x")
T5T5=COUNTIFS(G$2:G$100,"x",O$2:O$100,"x")
U5U5=SUMIFS(H$2:H$100,G$2:G$100,"x",O$2:O$100,"x")
T6T6=COUNTIFS(I$2:I$100,"x",K$2:K$100,"x")
U6U6=SUMIFS(J$2:J$100,K$2:K$100,"x",I$2:I$100,"x")
T7T7=COUNTIFS(M$2:M$100,"x",I$2:I$100,"x")
U7U7=SUMIFS(J$2:J$100,M$2:M$100,"x",I$2:I$100,"x")
T8T8=COUNTIFS(O$2:O$100,"x",I$2:I$100,"x")
U8U8=SUMIFS(J$2:J$100,O$2:O$100,"x",I$2:I$100,"x")
T9T9=COUNTIFS(K$2:K$100,"x",M$2:M$100,"x")
U9U9=SUMIFS(L$2:L$100,K$2:K$100,"x",M$2:M$100,"x")
T10T10=COUNTIFS(K$2:K$100,"x",O$2:O$100,"x")
U10U10=SUMIFS(L$2:L$100,K$2:K$100,"x",O$2:O$100,"x")
T11T11=COUNTIFS(M$2:M$100,"x",O$2:O$100,"x")
U11U11=SUMIFS(N$2:N$100,M$2:M$100,"x",O$2:O$100,"x")
T12T12=COUNTIFS(G$2:G$100,"x",I$2:I$100,"x",K$2:K$100,"x")
U12U12=SUMIFS(H$2:H$100,G$2:G$100,"x",I$2:I$100,"x",K$2:K$100,"x")
T13T13=COUNTIFS(G$2:G$100,"x",I$2:I$100,"x",M$2:M$100,"x")
U13U13=SUMIFS(H$2:H$100,G$2:G$100,"x",I$2:I$100,"x",M$2:M$100,"x")
T14T14=COUNTIFS(G$2:G$100,"x",I$2:I$100,"x",O$2:O$100,"x")
U14U14=SUMIFS(H$2:H$100,G$2:G$100,"x",I$2:I$100,"x",O$2:O$100,"x")
T15T15=COUNTIFS(G$2:G$100,"x",M$2:M$100,"x",K$2:K$100,"x")
U15U15=SUMIFS(H$2:H$100,G$2:G$100,"x",M$2:M$100,"x",K$2:K$100,"x")
T16T16=COUNTIFS(G$2:G$100,"x",O$2:O$100,"x",K$2:K$100,"x")
U16U16=SUMIFS(H$2:H$100,G$2:G$100,"x",O$2:O$100,"x",K$2:K$100,"x")
T17T17=COUNTIFS(G$2:G$100,"x",M$2:M$100,"x",O$2:O$100,"x")
U17U17=SUMIFS(H$2:H$100,G$2:G$100,"x",M$2:M$100,"x",O$2:O$100,"x")
T18T18=COUNTIFS(M$2:M$100,"x",I$2:I$100,"x",K$2:K$100,"x")
U18U18=SUMIFS(J$2:J$100,M$2:M$100,"x",I$2:I$100,"x",K$2:K$100,"x")
 
Upvote 0
Hopefully you can see that I'm trying to count and sum where things match. For example I want to count Sharp and Big Money in the row (SH/BM) on the right. But I only want to count those two. Not every instance where they show up together in the main body of the worksheet. i.e. where there is an "x" in sharp/big money/pro systems I would like the column on the right to put that in the correct area (SH/BM/PS) and not duplicate it the sharp/big money row, the sharp/pro systems row, and the big money/pro systems row.

I only sent in part of the sheet, the rest of it has the area on the right go all the way down to cover every combination of the five column headers.

I'm also guessing that if there is a fix for countifs there would be a fix for sumifs. Maybe not...

I know I'm doing a terrible job explaining this and maybe i can't be helped but thought I'd check with you guys.

Thanks so much for your help. This is a really great forum.
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

For T2 try
Excel Formula:
=COUNTIFS(G$2:G$100,"x",I$2:I$100,"x",K$2:K$100,"<>x",M$2:M$100,"<>x",O$2:O$100,"<>x")
 
Upvote 0
Solution
Glad we could & thanks for the feedback.

Also thanks for updating your profile (y)
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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