IF statements

  • Thread starter Thread starter Dwain Kincaid
  • Start date Start date
D

Dwain Kincaid

How do I use an IF statement to look at a column of data and if the current
value or text is repeated in that column to return a null or NA value?
 
I'm not entirely clear what you want displayed. If we display a "null" for
duplicates, then what do we display for unique entries. The formula below
assumes we will show unique items and show nothing for an items that are not
unique...

=IF(COUNTIF(A:A,"="&A1)=1,A1,"")

Here I have assumed your data is in Column A.

Rick
 
I keep forgetting that you don't need the "=" part for text constants. This
will also work...

=IF(COUNTIF(A:A,A1)=1,A1,"")

Rick
 
Dwain Kincaid said:
How do I use an IF statement to look at a column of data and if the current
value or text is repeated in that column to return a null or NA value?

One way
Assuming data to be looked at is running in A1 down
you could put in say, B1:
=IF(A1="","",IF(COUNTIF(A:A,A1)>1,"",A1))
and copy down to the max expected extent of data in col A

---
 
Rick:

Actually I want the first instance of a duplicate to show up and then any
repeats to either show null of "".
 
Then give this formula a try...

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

Rick
 
Back
Top