Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default using IF statement to compare text

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default using IF statement to compare text

You are extremely close:

=IF(A1=A2,"e","ne")
--
Gary's Student


"RichN" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default using IF statement to compare text

Ouch! Thanks.

"Gary''s Student" wrote:

You are extremely close:

=IF(A1=A2,"e","ne")
--
Gary's Student


"RichN" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default using IF statement to compare text

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

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



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default using IF statement to compare text

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

On Wed, 1 Nov 2006 12:56:02 -0800, RichN
wrote:

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?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If statement to compare for wildcard value in another cell. Karen53 Excel Worksheet Functions 3 July 12th 06 05:28 AM
Can I create an If Statement that will replace text kalikw Excel Worksheet Functions 4 March 30th 06 02:34 AM
How change dimensions of data label text box in pie chart? Gouden Willem Charts and Charting in Excel 3 March 7th 06 12:11 PM
how to compare 6 columns of text data Deeptiman Excel Worksheet Functions 2 January 20th 06 07:13 PM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"