Counting multiple conditions in same range

TBertot107

New Member
Joined
Jun 3, 2024
Messages
13
Office Version
  1. 365
Platform
  1. Windows
=SUMPRODUCT(COUNTIF($B$2:$F$1000,$I$2))-SUMPRODUCT(COUNTIF($B$2:$F$1000,K$1))



6​
 

Attachments

  • Paint.jpg
    Paint.jpg
    37 KB · Views: 25

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
welcome to the forum. Is column 1 an A column or a B column.
What is the value in cells I1 and K1.

What is your expected result? (is it 6?)
 
Upvote 0
The values in I2 is 1. The value in K1 is 2. The ranges I am looking in is B2:F1000. The total value of 1 is 121 and 2 129 respectively. It is coming back with a -8 which is the difference between them. I am trying to get the total of the combination of 1 & 2.

=SUMPRODUCT(COUNTIF($B$2:$F$1000,$I$2))-SUMPRODUCT(COUNTIF($B$2:$F$1000,K$1)) I understand why I am getting the -8 but don't know how to get the total combinations of 1 & 2. Which should be 18.
 
Upvote 0
Not sure how to use that XL2BB or I would have copied the entire spreadsheet and sent it to you.
 
Upvote 0
welcome to the forum. Is column 1 an A column or a B column.
What is the value in cells I1 and K1.

What is your expected result? (is it 6?)
The values in I2 is 1. The value in K1 is 2. The ranges I am looking in is B2:F1000. The total value of 1 is 121 and 2 129 respectively. It is coming back with a -8 which is the difference between them. I am trying to get the total of the combination of 1 & 2.

=SUMPRODUCT(COUNTIF($B$2:$F$1000,$I$2))-SUMPRODUCT(COUNTIF($B$2:$F$1000,K$1)) I understand why I am getting the -8 but don't know how to get the total combinations of 1 & 2. Which should be 18.
 
Upvote 0
Last edited:
Upvote 0
I counted nine 1's and nine 2's so why is the expected answer 9? Perhaps this.
Book1
BCDEFGHIJKLMNOPQRST
11234567891011
212172935118181210111010101099
312131727218181210111010101099
41213232731212645444433
512391841010423222211
6125293351111534333322
712583161010423222211
8123223371010423222211
9126730
10123417
Sheet1
Cell Formulas
RangeFormula
J2:T8J2=COUNTIFS($B$2:$F$10,$I2)+COUNTIFS($B$2:$F$10,J$1)
000
I counted nine 1's and nine 2's so why is the expected answer 9? Perhaps this.
Book1
BCDEFGHIJKLMNOPQRST
11234567891011
212172935118181210111010101099
312131727218181210111010101099
41213232731212645444433
512391841010423222211
6125293351111534333322
712583161010423222211
8123223371010423222211
9126730
10123417
Sheet1
Cell Formulas
RangeFormula
J2:T8J2=COUNTIFS($B$2:$F$10,$I2)+COUNTIFS($B$2:$F$10,J$1)
The answer should have been 9. There are 9 1 & 2 combinations in rows 2 - 10.
 
Upvote 0
000

The answer should have been 9. There are 9 1 & 2 combinations in rows 2 - 10.
Are you counting row by row? In this example, what would the expected result be?
Book1
BCDEF
1
212172935
302131727
402132327
5023918
60252933
7025831
80232233
9026730
10023417
Sheet1
 
Upvote 0
Are you counting row by row? In this example, what would the expected result be?
Book1
BCDEF
1
212172935
302131727
402132327
5023918
60252933
7025831
80232233
9026730
10023417
Sheet1
The count should be 9. The total of 1 & 2 together. From 3 to 10 there should be 1's in there. Somehow I now see 0's.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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