using IF statement to compare text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a long list of items in Excel. I have been trying to use the IF
statements to compare items in the list, so that I might delete the repeated
items.

Please note: the whole list is text. There are no numbers.

I have been trying to use

=IF(A1=A2),"same","not same"

but keep getting an error.

Please help, or perhaps suggest another function to use?
 
Here's one way:

Assume your data is in the range A1:A20. The first instance of a value is
considered the original and is therefore not flagged:

To flag the repeats enter this formula in B1 and copy down to B20:

=IF(COUNTIF(A$1:A1,A1)>1,"repeat","")

Biff
 
The error comes from an incorrect syntax.

Should be =IF(A2=A1,"same","not same")

Better formula would be this one from Chip Pearson.

=IF(COUNTIF($A$1:$A$300,A1)>1,"Duplicate","Not Duplicate")

For more on duplicates management see Chip's site at

http://www.cpearson.com/excel/duplicat.htm


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top