Formula for COUNTIF

NeoSez

Board Regular
Joined
Aug 14, 2020
Messages
210
Office Version
  1. 2019
  2. 2010
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,215,181
Messages
6,123,513
Members
449,101
Latest member
mgro123

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