Count blank Multiple condition

mira2020

New Member
Joined
Sep 25, 2020
Messages
27
Office Version
  1. 2016
hi all,

I need help to write count formula. I want to count for each Fruit type, the number of cell in column B is 0 or blank .
there is formula in column B, so if it blank, means the formula return a blank value . Count still return 1 if the value is blank because the formula is there, but i want it return 0
Thanks.


1700464117895.png
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I am a little confused as to what you are trying to count.
Since the Countif(s) only have an issue when you are trying to exclude just the blanks I have assumed you want to count everything except blanks.

20231120 Count ignore blanks mira2020.xlsx
ABCDEFG
1FruitPriceSumProd not blankCountIfs not blank
2Apple1Apple33
3Apple0Orange11
4Orange3Banana22
5Apple4
6Orange 
7Banana0
8Banana0
Sheet1
Cell Formulas
RangeFormula
F2:F4F2=SUMPRODUCT(($A$2:$A$8=E2)*($B$2:$B$8<>""))
G2:G4G2=COUNTIFS($A$2:$A$8,E2,$B$2:$B$8,">=0")
B6B6=""
 
Upvote 0
You could adjust the formula that creates the values in column B to return a 0 instead of a blank or use one of the methods below:
Book1
ABCDEFGH
1FruitPrice
2Apple1Apple11
3Apple0Orange11
4Orange3Banana22
5Apple4
6Orange 
7Banana0
8Banana0
Sheet1
Cell Formulas
RangeFormula
G2:G4G2=COUNTIFS($A$2:$A$8,F2,$B$2:$B$8,"<1")+COUNTIFS($A$2:$A$8,F2,$B$2:$B$8,"")
H2:H4H2=SUMPRODUCT(($A$2:$A$8=F2)*(($B$2:$B$8<1)+($B$2:$B$8="")))
B2B2=1
B3,B7:B8B3=0
B4B4=3
B5B5=4
B6B6=""
 
Upvote 0
@Georgiboy, the results the OP has given are at odds with the statement
Count still return 1 if the value is blank because the formula is there, but i want it return 0
And just counting the 0s and excluding the blanks is easy
This will do that.
Excel Formula:
=COUNTIFS($A$2:$A$8,E2,$B$2:$B$8,0)

So I suspect that the example is flawed.
Hopefully the OP will come back and clarify.
 
Upvote 0
I mainly looked at the below part of the OP:
I want to count for each Fruit type, the number of cell in column B is 0 or blank

The countifs function will not count "" as part of "<1" for example, so i have assumed the TS wants to count 0's and "" together as one.
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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