How to remove 0's in blank cells when using COUNTIF

TOM2RN

Board Regular
Joined
Mar 17, 2009
Messages
61
This should be simple, but I can't locate an answer. I am using Excel 2010 and have been using the formula =COUNTIF(A1:A5, "X") to count the number of times it (the X) appears in my range. This always places a 0 in the cell unless the X occurs somewhere in the range. How can I have the cell remain blank until there is an occurence. or for that matter, remain blank if there is no occurrence? It's a bit annoying to see 0's in a bunch of cells on a page.

Thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
This should be simple, but I can't locate an answer. I am using Excel 2010 and have been using the formula =COUNTIF(A1:A5, "X") to count the number of times it (the X) appears in my range. This always places a 0 in the cell unless the X occurs somewhere in the range. How can I have the cell remain blank until there is an occurence. or for that matter, remain blank if there is no occurrence? It's a bit annoying to see 0's in a bunch of cells on a page.

Thanks

If a real blank is necessary...

=IF(COUNTIF(A1:A5,"X"),COUNTIF(A1:A5,"X"),"")

You could also keep your current formula and custom format the formula cell as:

[=0]"";General
 
Upvote 0
This should be simple, but I can't locate an answer. I am using Excel 2010 and have been using the formula =COUNTIF(A1:A5, "X") to count the number of times it (the X) appears in my range. This always places a 0 in the cell unless the X occurs somewhere in the range. How can I have the cell remain blank until there is an occurence. or for that matter, remain blank if there is no occurrence? It's a bit annoying to see 0's in a bunch of cells on a page.

Thanks
One way...

=IF(COUNTIF(A1:A5,"x"),COUNTIF(A1:A5,"x"),"")
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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