COUNTIF returning blank cell if value is 0

Chand

Board Regular
Joined
Jan 26, 2004
Messages
60
Hiya...

I've been using the following formula to count the number of cells containing criteria, eg 32.

=COUNTIF(April!G:G,"32")

If no cells contain 32 I get a result of 0. What I'd like is a formula that returns a blank cell if the result is zero.

I've tried various combinations but I'm not even sure if this is a COUNTIF function... any help would be appreciated!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hello,

Try

=IF(COUNTIF(April!G:G,"32")=0,"",COUNTIF(April!G:G,"32"))

Has this solved the issue?
 
Upvote 0
Chand said:
...What I'd like is a formula that returns a blank cell if the result is zero.

Formulas can't return a blank cell... they can return a null string, "". Why don't you just format the cell containing the COUNTIF formula using...

0;;;
 
Upvote 0
Chand said:
Hiya...

I've been using the following formula to count the number of cells containing criteria, eg 32.

=COUNTIF(April!G:G,"32")

If no cells contain 32 I get a result of 0. What I'd like is a formula that returns a blank cell if the result is zero.

I've tried various combinations but I'm not even sure if this is a COUNTIF function... any help would be appreciated!
Hi Chand:

You may want to have a rethink about having a formula to display a blank.

In case no cell contains 32, the effective count indeed is 0, if you don't want to display 0, then this is a formating issue ... in that case you can do one of two things ...

1) Custom Format the cell as ... [=0]"";General
2) use TOOLS|Options|View|Window_options ... uncheck Display_Zero_Values to not display Zero_values in the entire worksheet
 
Upvote 0
Mark W. said:
Chand said:
...What I'd like is a formula that returns a blank cell if the result is zero.

Formulas can't return a blank cell... they can return a null string, "". Why don't you just format the cell containing the COUNTIF formula using...

0;;;

Thanks! :-D
 
Upvote 0
thank you very much for sharing your formula sir/mam onlyadrafter . i truly appreciate your help although i did not directly ask help regarding this, but when i try to look for help with the same problem i have in mind you've help me with it. thank you very much.
 
Upvote 0

Forum statistics

Threads
1,223,226
Messages
6,170,843
Members
452,360
Latest member
abishekjmichael

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