Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Grant
 
Posts: n/a
Default Compare cell values

I have a number of cells, each containing a different string value. Is there
a way for me to determine whether a string from position A1 in my sheet,
exists anywhere else in that same column on my sheet.

ie does text from Cell A1 match any text between Cell A2 and Cell A100?

Thanks,
Grant


  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Grant

one option
=IF(ISNUMBER(MATCH(A1,A2:A100,0)),"found","not found")

or
=IF(COUNTIF(A2:A100,A1)=1,"found","not found")

- or if you want to return the row number of where it is found just use
MATCH(A1,A2:A100,0)+1

Hope this helps
Cheers
JuileD


"Grant" wrote in message
...
I have a number of cells, each containing a different string value. Is
there a way for me to determine whether a string from position A1 in my
sheet, exists anywhere else in that same column on my sheet.

ie does text from Cell A1 match any text between Cell A2 and Cell A100?

Thanks,
Grant



  #3   Report Post  
Grant
 
Posts: n/a
Default

Excellent thanks Juile! Just one question, is there a way to use the countif
formula to search every row from A1 to A100 excluding the current row? Your
formula COUNTIF(A2:A100,A1) works great but when I drag it down the column
it searches from that point on and not any previous cells.

So is there a way to do search every row from A1:A100 except for the current
row?
Something like =COUNTIF( IF ( Current cell not = A1 then use the array(
$A2:$A100 )), A1)

or something similar? I hope Im making sense...


"JulieD" wrote in message
...
Hi Grant

one option
=IF(ISNUMBER(MATCH(A1,A2:A100,0)),"found","not found")

or
=IF(COUNTIF(A2:A100,A1)=1,"found","not found")

- or if you want to return the row number of where it is found just use
MATCH(A1,A2:A100,0)+1

Hope this helps
Cheers
JuileD


"Grant" wrote in message
...
I have a number of cells, each containing a different string value. Is
there a way for me to determine whether a string from position A1 in my
sheet, exists anywhere else in that same column on my sheet.

ie does text from Cell A1 match any text between Cell A2 and Cell A100?

Thanks,
Grant






  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Grant wrote...
....
So is there a way to do search every row from A1:A100 except for the

current
row?

....

If you mean the formula in, say, A23 would check for instances of the
value of A23 in A1:A22 and A24:A100, then try

=IF(SUMPRODUCT((A$1:A$100=A23)*(ROW(A$1:A$100)<RO W(A23)),"found","not
found")

Alternatively, you could use

A1:
=IF(COUNTIF(A2:A100,A1),"found","not found")

A2 (then filled into A3:A99):
=IF(COUNTIF(A$1:A1,A2)+COUNTIF(A3:A$100,A2),"found ","not found")

A100:
IF(COUNTIF(A1:A99,A100),"found","not found")

  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

Or maybe you could just check to see if the results were 1 (instead of =1).

=if(countif($a$1:$a$100,a1)1,"Found somewhere else besides this cell","Nope")



Grant wrote:

Excellent thanks Juile! Just one question, is there a way to use the countif
formula to search every row from A1 to A100 excluding the current row? Your
formula COUNTIF(A2:A100,A1) works great but when I drag it down the column
it searches from that point on and not any previous cells.

So is there a way to do search every row from A1:A100 except for the current
row?
Something like =COUNTIF( IF ( Current cell not = A1 then use the array(
$A2:$A100 )), A1)

or something similar? I hope Im making sense...

"JulieD" wrote in message
...
Hi Grant

one option
=IF(ISNUMBER(MATCH(A1,A2:A100,0)),"found","not found")

or
=IF(COUNTIF(A2:A100,A1)=1,"found","not found")

- or if you want to return the row number of where it is found just use
MATCH(A1,A2:A100,0)+1

Hope this helps
Cheers
JuileD


"Grant" wrote in message
...
I have a number of cells, each containing a different string value. Is
there a way for me to determine whether a string from position A1 in my
sheet, exists anywhere else in that same column on my sheet.

ie does text from Cell A1 match any text between Cell A2 and Cell A100?

Thanks,
Grant





--

Dave Peterson


  #6   Report Post  
Grant
 
Posts: n/a
Default

Thanks thats perfect! I think I remember trying something similar but
couldnt get it to work.

"Dave Peterson" wrote in message
...
Or maybe you could just check to see if the results were 1 (instead of
=1).


=if(countif($a$1:$a$100,a1)1,"Found somewhere else besides this
cell","Nope")



Grant wrote:

Excellent thanks Juile! Just one question, is there a way to use the
countif
formula to search every row from A1 to A100 excluding the current row?
Your
formula COUNTIF(A2:A100,A1) works great but when I drag it down the
column
it searches from that point on and not any previous cells.

So is there a way to do search every row from A1:A100 except for the
current
row?
Something like =COUNTIF( IF ( Current cell not = A1 then use the array(
$A2:$A100 )), A1)

or something similar? I hope Im making sense...

"JulieD" wrote in message
...
Hi Grant

one option
=IF(ISNUMBER(MATCH(A1,A2:A100,0)),"found","not found")

or
=IF(COUNTIF(A2:A100,A1)=1,"found","not found")

- or if you want to return the row number of where it is found just use
MATCH(A1,A2:A100,0)+1

Hope this helps
Cheers
JuileD


"Grant" wrote in message
...
I have a number of cells, each containing a different string value. Is
there a way for me to determine whether a string from position A1 in my
sheet, exists anywhere else in that same column on my sheet.

ie does text from Cell A1 match any text between Cell A2 and Cell
A100?

Thanks,
Grant





--

Dave Peterson



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
set hypothetical values for a cell chris8715 Excel Worksheet Functions 1 February 22nd 05 05:18 PM
Formula to compare multiple rows values based on another column? Murph Excel Worksheet Functions 4 February 21st 05 02:44 AM
How do I write formula to compare two values and pull the resulta. Renee Excel Worksheet Functions 1 February 11th 05 01:31 AM
Toggle multiple values in single cell Chandni Excel Worksheet Functions 5 February 10th 05 12:48 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 08:21 PM.

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

About Us

"It's about Microsoft Excel"