How do I fix this error (excel thinks two different values are the same)

arielks

New Member
Joined
Mar 15, 2019
Messages
6
This is messing my entire spreadsheet up.

I have two invoice numbers:
1: 4189032830052819
2: 4189032830052818

they differ by one number (representing the year but that's irrelevant)

if I go:
Countif(A1:A2,A1)
the result I get is 2, even though A1 only exists once.

similarly if I do conditional formatting to show duplicates, excel thinks these two are duplicates and highlights them.

How do i get around that? (I can't change these Invoice numbers, they have to stay the same for consistency with other functionalities of the spreadsheet)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
This just showed up yesterday in a thread. It appears there is a bug in Excel where COUNTIF incorrectly matches numbers saved as text longer than a certain number of digits. You can get around it with something like:

=SUMPRODUCT(--(A1:A2=A1))
 
Upvote 0
Try the array version:

=MAX(IF(A1:A3=A1,B1:B3))

confirmed with Control+Shift+Enter.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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