ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF statements (https://www.excelbanter.com/excel-worksheet-functions/172040-if-statements.html)

Dwain Kincaid

IF statements
 
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?

ryguy7272

IF statements
 
This is slightly different than what you described, but it may be more in
sync with what you are looking for:
http://www.cpearson.com/excel/Duplicates.aspx


Hope that helps,
Ryan--



--
RyGuy


"Dwain Kincaid" wrote:

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?


Rick Rothstein \(MVP - VB\)

IF statements
 
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


"Dwain Kincaid" <Dwain wrote in message
...
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?



Rick Rothstein \(MVP - VB\)

IF statements
 
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


"Rick Rothstein (MVP - VB)" wrote in
message ...
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


"Dwain Kincaid" <Dwain wrote in message
...
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?




Max

IF statements
 
"Dwain Kincaid" wrote:
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
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

Dwain Kincaid[_2_]

IF statements
 
Rick:

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

"Rick Rothstein (MVP - VB)" wrote:

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


"Rick Rothstein (MVP - VB)" wrote in
message ...
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


"Dwain Kincaid" <Dwain wrote in message
...
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?





Rick Rothstein \(MVP - VB\)

IF statements
 
Then give this formula a try...

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

Rick


"Dwain Kincaid" wrote in message
...
Rick:

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

"Rick Rothstein (MVP - VB)" wrote:

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


"Rick Rothstein (MVP - VB)" wrote in
message ...
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


"Dwain Kincaid" <Dwain wrote in
message
...
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?






All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com