Issues with countif and values of 0

tfpearce

New Member
Joined
Jul 25, 2016
Messages
1
Here is my enigma...
I have cells that contain a "0". They test TRUE as Text, and FALSE as a number, yet every variation I have tried with a CountIf (or countifs) function does not test as expected. In the text posted below, the 'formula' listed in column 2 is also in Column 3 with the value returned.
I tried formatting the cells holding the values as GENERAL, TEXT, and NUMBER (noted in each column). Those cells containing TEXT do not evaluate as expected for the "Not Equal To" text of <>. Any one else have this issue and resolve it? I am using Excel in Microsoft Office Professional Plus 2010, running version 14.0.7015.1000

In EXCEL the first two sets of formulas have a value of 0 that is left justified and have the green box in the upper left corner to show they are 'text'. In the second two sets, the values are numeric values of 0.

:confused:

Format
GeneralFunctionValue Returned
0=ISTEXT($A3)TRUE
0=ISNUMBER($A4)FALSE
0=COUNTIF($A5,"'=0")1
0=COUNTIF($A6,"<>0")1
0=COUNTIF($A7,"'="&"0")1
0=COUNTIF($A8,"<>"&0)1
0=COUNTIF($A9,"<>"&"0")1
0=LEN($A10)1
TextFunctionValue Returned
0=ISTEXT($A3)TRUE
0=ISNUMBER($A4)FALSE
0=COUNTIF($A5,"'=0")1
0=COUNTIF($A6,"<>0")1
0=COUNTIF($A7,"'="&"0")1
0=COUNTIF($A8,"<>"&0)1
0=COUNTIF($A9,"<>"&"0")1
0=LEN($A10)1
GeneralFunctionValue Returned
0=ISTEXT($A3)FALSE
0=ISNUMBER($A4)TRUE
0=COUNTIF($A5,"'=0")1
0=COUNTIF($A6,"<>0")0
0=COUNTIF($A7,"'="&"0")1
0=COUNTIF($A8,"<>"&0)0
0=COUNTIF($A9,"<>"&"0")0
0=LEN($A10)1
NumberFunctionValue Returned
0=ISTEXT($A3)FALSE
0=ISNUMBER($A4)TRUE
0=COUNTIF($A5,"'=0")1
0=COUNTIF($A6,"<>0")0
0=COUNTIF($A7,"'="&"0")1
0=COUNTIF($A8,"<>"&0)0
0=COUNTIF($A9,"<>"&"0")0
0=LEN($A10)1

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Was this data imported from somewhere? If so, did you change the cell format to number then double click/press F2/click on the formula window and enter for some of the cells but not all?

Note that putting an apostrophe in front of the zero won't exclude it from countif:


Excel 2010
A
10
20
32
Sheet8
Cell Formulas
RangeFormula
A3=COUNTIF(A1:A2,0)



One way to discern numerical zeroes from text:


Excel 2010
AB
10
20A2 has apostrophe
31
40
5
63
7
82
Sheet8
Cell Formulas
RangeFormula
A6=COUNTIF(A1:A4,0)
A8=SUMPRODUCT(ISNUMBER(A1:A4)*(A1:A4=0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

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