countif formula not working properly?

Sayre

Board Regular
Joined
Apr 12, 2005
Messages
180
In cell A1 I have the following value: 108820751000620
In cell A2 I have the following value: 108820751000620.004

They are in text format.

In cell B1 I have the following formula: "=COUNTIF(A:A,A1)"
In cell B2 I have the following formula: "=COUNTIF(A:A,A2)"

There is nothing else on the entire spreadsheet.

The result of both of these formulas is coming up as 2, so Excel must be regarding the two values in Col A as the same thing, but they are clearly not. What could possibly be causing this?

When I try to change them from text format to general format using the Text To Columns method, the ".004" portion of cell A2 disappears and then the two cells really do equal each other. This is baffling to me and I don't think Excel was behaving this way before. I had been fiddling with the "Precision As Displayed" and "maximum Change" commands from the Options menu earlier, but I have since turned off Precisions As Displayed and set the Maximum Change to 0. Perhaps that's what's causing this but I don't know what to do to fix. I just want the Countif formulas to work properly and recognize that the values in cells A1 and A2 are different/unique.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I believe you are hitting the 15 digit limit for numbers. The first 15 digits of your numbers are the same.
 
Upvote 0
CountIf/SumIf are bound by item length of 15 digits/chars...

Try...

=SUMPRODUCT(($A$2:$A$100=D1)+0)

D1 downwards houses the unique items that you want to count their occurrences in A2:A100 (whole columns are not allowed, unless you are on Excel 2007).
 
Upvote 0
Ugh, that is going to be very troublesome for what I am trying to do. Does this limit apply only to numbers or to any characters? Numbers and letters?
 
Upvote 0
Ugh, that is going to be very troublesome for what I am trying to do. Does this limit apply only to numbers or to any characters? Numbers and letters?

Chars stand for characters...
 
Upvote 0
I think it is only numbers. If you add a letter to either of your numbers, then then countif that you are using does work.
 
Upvote 0
I tacked on the letter "a" to the end of both values in Col A and now the formulas give me the proper value of 1, thanks klb!

I think I'll still try Aladin's SumProduct solution though. I dont want to have to tack letters onto this every time I do it, but its good to know I can do that in a pinch.
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

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