Formula for COUNTIF

NeoSez

Board Regular
Joined
Aug 14, 2020
Messages
243
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I am trying to create a formula for countif.
Let's say I have Apples, Oranges, and Pears.
But some are green and some are red.
I would like a count of how many apples are red and how many are green.
Or how many oranges are green or how many are red. etc...
Can someone help me with the formula? Thanks.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Another way.

Book1
ABCDE
1AppleRedFruitApple
2AppleYellowColorRed
3ApplePink1
4BananaRed
5BananaYellow
6BananaPink
7OrangeRed
8OrangeYellow
9OrangePink
Sheet4
Cell Formulas
RangeFormula
E3E3=SUMPRODUCT(--(A1:A9&B1:B9=E1&E2))
 
Upvote 0
Another way.

Book1
ABCDE
1AppleRedFruitApple
2AppleYellowColorRed
3ApplePink1
4BananaRed
5BananaYellow
6BananaPink
7OrangeRed
8OrangeYellow
9OrangePink
Sheet4
Cell Formulas
RangeFormula
E3E3=SUMPRODUCT(--(A1:A9&B1:B9=E1&E2))
Thank you for suggesting this as well. I will keep this in mind for the next time.
 
Upvote 0
Thank you Scott. I was missing the "S" in Countifs. What is the difference between Countif and Countifs? I thought they were the same.
COUNTIF counts a single condition. COUNTIFS counts multiple conditions
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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