Countif doesn't recognize some cells

Bram1988

New Member
Joined
May 13, 2014
Messages
7
Excel 2007
Windows 8

Hi all,

For this project i need to analyze clusters of data. My first step is to remove all none duplicates.
I have created this formula =COUNTIF(N:N,N1)=1, this goes all the way down to =COUNTIF(N:N,N5443)=1. My plan is to remove all rows that return a "True" to delete all non-duplicates.

I'm noticing, although 90% is recognized correctly, 10% is not. Some formulas return as true, when clearly there are duplicate values.
The N Column is trimmed, to correct for spaces.

Does anyone have an idea how to solve this, or what the pitfalls with countif formulas usually are in this situation?



[TABLE="width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]N Column[/TD]
[TD]O Column[/TD]
[/TR]
[TR]
[TD]=COUNTIF(N:N,N5441)=1
Returns False[/TD]
[TD]Trim(05441)[/TD]
[TD]89365K[/TD]
[/TR]
[TR]
[TD]=COUNTIF(N:N,N5442)=1
Returns as False[/TD]
[TD]Trim(O5442)[/TD]
[TD]89365K[/TD]
[/TR]
[TR]
[TD]=COUNTIF(N:N,N5443)=1
Returns as True[/TD]
[TD]Trim(O5443)[/TD]
[TD]002567[/TD]
[/TR]
[TR]
[TD]=COUNTIF(N:N,N5444)=1
Returns as True[/TD]
[TD]Trim(O5444)[/TD]
[TD]002567[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi Bram,

There are some characters which look like spaces but they are not and hence they can't go after applying TRIM function.
Can you check and confirm ?



Regards,
DILIPandey
 
Upvote 0
Hi Bram,

There are some characters which look like spaces but they are not and hence they can't go after applying TRIM function.
Can you check and confirm ?



Regards,
DILIPandey

You are totally right! It seems some " invisible" characters are still there. Is there any way to remove those without manually checking 5000 cells?
 
Upvote 0
Bram1988,

Just in case there are some 'invisible' control characters in O maybe try...

=TRIM(CLEAN(O1)) in N1

Or, to be sure that you catch Char(160) if it exists then try.....

=SUBSTITUTE(TRIM(CLEAN(O1)),CHAR(160),"")

Hope that helps.
 
Upvote 0
Oke, This must have been a newbie question for the both of you, but i'm so gratefull. This worked perfectly!
I trusted the trim function to do it's job not expecting other character to still be there.
Thanks a lot!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,930
Members
452,367
Latest member
TePunaBloke

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