Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default search Sheet2! for the contents of Sheet1!

Hello, I have scratched my head far too long and need some help.
Sheet1! column A contains short names. Sheet2! column A contains full
names. Here is what i would like to do. If the short name in Sheet1
cell A1 is found in any of the full names in Sheet2 column A then
Sheet1 cell = 'yes' otherwise = null.
Thanks,
Wes

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default search Sheet2! for the contents of Sheet1!

In Sheet1 cell B1:

=if(isnumber(match(a1,sheet2!a:a,0)),"Yes","")

(and drag down)

Fester wrote:

Hello, I have scratched my head far too long and need some help.
Sheet1! column A contains short names. Sheet2! column A contains full
names. Here is what i would like to do. If the short name in Sheet1
cell A1 is found in any of the full names in Sheet2 column A then
Sheet1 cell = 'yes' otherwise = null.
Thanks,
Wes


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default search Sheet2! for the contents of Sheet1!

Thanks Dave but that does not appear to work.
For example Sheet1! cell A1 has the following name proceeded by a
space: Mike Comrie
Somewhere in Sheet2! column A is the name: Mike Comrie C
I need this to be considered a match. ie. if whatever is in Sheet1!
cell A1 is found in any position of a cell in colum A1 of Sheet2! then
that is a match and Sheet1! cell B1 would be set to yes.
Thanks to all that help.
Wes

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default search Sheet2! for the contents of Sheet1!

Excel likes exact matches--just like most mechanized things.

But maybe...
=if(isnumber(match("*"&a1&"*",sheet2!a:a,0)),"Yes" ,"")


Fester wrote:

Thanks Dave but that does not appear to work.
For example Sheet1! cell A1 has the following name proceeded by a
space: Mike Comrie
Somewhere in Sheet2! column A is the name: Mike Comrie C
I need this to be considered a match. ie. if whatever is in Sheet1!
cell A1 is found in any position of a cell in colum A1 of Sheet2! then
that is a match and Sheet1! cell B1 would be set to yes.
Thanks to all that help.
Wes


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default search Sheet2! for the contents of Sheet1!

In .com, Fester
spake thusly:

Thanks Dave but that does not appear to work. For example
Sheet1! cell A1 has the following name proceeded by a
space: Mike Comrie
Somewhere in Sheet2! column A is the name: Mike Comrie C
I need this to be considered a match. ie. if whatever is in
Sheet1! cell A1 is found in any position of a cell in colum A1 of
Sheet2! then that is a match and Sheet1! cell B1 would be set to
yes. Thanks to all that help.


[(Dave Peterson had written:]

In Sheet1 cell B1:
=if(isnumber(match(a1,sheet2!a:a,0)),"Yes",""


Wes, in that case, use a -1 where Dave has a 0, as an arg to
the MATCH statement.

=if(isnumber(match(a1,sheet2!a:a,-1)),"Yes",""


However, you will run into problems if one name is, for example,
Steve Smith, and another (on Sheet2!) is Steve Smithson.

-dman-


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 751
Default search Sheet2! for the contents of Sheet1!

How about

=IF(SUMPRODUCT(--ISNUMBER(FIND(Sheet1!A1:A100,Sheet2!A1:A3000))),"y es","no")

HTH
Kostis Vezerides

Fester wrote:
Hello, I have scratched my head far too long and need some help.
Sheet1! column A contains short names. Sheet2! column A contains full
names. Here is what i would like to do. If the short name in Sheet1
cell A1 is found in any of the full names in Sheet2 column A then
Sheet1 cell = 'yes' otherwise = null.
Thanks,
Wes


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default search Sheet2! for the contents of Sheet1!

Many thanks to all who have helped.
=if(isnumber(match("*"&a1&"*",sheet2!a:a,0)),"Yes" ,"")
worked great and now I can have a good weekkend.
Wes

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default search Sheet2! for the contents of Sheet1!

In .com, Fester
spake thusly:

Many thanks to all who have helped.
=if(isnumber(match("*"&a1&"*",sheet2!a:a,0)),"Yes" ,"")
worked great and now I can have a good weekkend.


Dave Peterson suggested that, and it is, indeed, clever.
But in my humble opinion it has some problems with regard
to your stated goals. You had said in Message-ID:
.com
(and I really wish you'd leave a bit of context in from
prior posts so I or others wouldn't have to go find this
stuff again!):

For example Sheet1! cell A1 has the following name proceeded
by a space: Mike Comrie Somewhere in Sheet2! column A is the
name: Mike Comrie C I need this to be considered a match. ie.
if whatever is in Sheet1! cell A1 is found in any position of

^^^^^^^^^^^^^^^
a cell in colum A1 of Sheet2! then that is a match and Sheet1!
cell B1 would be set to yes.


(Emphasis, of course, added by me.)


Well, The above formula will NOT match if there is a leading space
on "Mike Comrie" on your Sheet1, but no leading space on Sheet2.

Or did you perhaps mean by "in any position," simply, "in any row"?
In that case, then Dave's latest is good. But that's not how
I read "in any position." I thought you meant there could be no
leading space on Sheet2.

If spacing is irregular, then my suggestion building on Dave's
earlier formula still works:

=if(isnumber(match(a1,sheet2!a:a,-1)),"Yes","")

I simply changed his "0" argument to MATCH to "-1", as I already posted.

However, both Dave's latest suggestion and the one you went with
suffer from one or another version of the flaw I pointed out
already. So I don't think you should be quite ready for that
weekend scotch!

Specifically, suppose you have (to make this more personal
to this thread), in Column A of Sheet1, with leading spaces,

Dave Peters
Anny Smith
Wes Finch


and suppose you have on Sheet2 in Column A somewhe

Dave Peterson C
Manny Smith-Anderson D
Wes Finchelman E

Well, my friend, you're going to get some bum "matches"! Probably
not what you want. With Dave's latest, supposing Sheet2 *does*
also have at least one leading space, you'll match falsely on
"Dave Peters" and "Wes Finch". And if Sheet2 has no leading
spaces, you won't match on anything at all. On the other hand,
with the alternate formula I suggested, you'll get false positive
matches on all of the names in my sample list; however, the lack
of a leading space on Sheet2 won't be a problem.

I just tried Kostis Vezerides's suggestion of

=IF(SUMPRODUCT(--ISNUMBER(FIND(Sheet1!A1:A100,Sheet2!A1:A3000))),"y es","no")

and can't get it to work at all, unfortunately -- leading spaces or no.
(I also took the set ranges out and tried it with just A:A in both places.
Still no dice.)

-dman-
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default search Sheet2! for the contents of Sheet1!

In , Dallman Ross <dman@localhost.
spake thusly:

However, both Dave's latest suggestion and the one you went with


Erm, I meant "both my suggestion and Dave's latest, which you
went with . . ."

-dman-
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
build a search tool in excel Obi-Wan Kenobi Excel Discussion (Misc queries) 1 March 18th 06 03:21 PM
Question regarding how to search a column and print a row(s) Max Excel Discussion (Misc queries) 0 July 15th 05 04:14 AM
Question regarding how to search a column and print a row(s) Max Excel Worksheet Functions 0 July 15th 05 04:14 AM
Looking for comparable data records between Sheet1 and Sheet2 Jim May Excel Discussion (Misc queries) 3 April 1st 05 08:04 PM
FAQ Spreadsheet with search function murphyz Excel Discussion (Misc queries) 0 March 19th 05 09:24 PM


All times are GMT +1. The time now is 04:25 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"