Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Check for same Names in cells

Hi all

If John Smith is in A2 How can I check that John Smith is in a sentence in
K2.

I have other names in Columns so I'm probably looking for a formula to place
in L2 then copy down column.

Thanks in advance

Dave




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Check for same Names in cells

If John Smith is in A2 How can I check that John Smith is in a sentence in
K2.

I have other names in Columns so I'm probably looking for a formula to
place
in L2 then copy down column.


You might be able to use this...

=ISNUMBER(SEARCH(A2,K2))

However, be aware, it could produce false positives. For example, if the
text in K2 contained the name John Smithville, the formula would return TRUE
because the text "John Smith" is contained within the text "John
Smithville". If you knew that the **only** characters around the name you
wanted to find were blank spaces (no periods, commas, parentheses, etc.),
then you could find and exact match this way...

=ISNUMBER(SEARCH(" "&A18&" "," "&K18&" "))

If characters other than spaces are possible, then you would have to be able
to delineate all of them in order to modify the formula to work.

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Check for same Names in cells

Dave,

try this formula in L2:

=IF(ISNUMBER(SEARCH(A2,K2,1)), TRUE, FALSE)


It will return TRUE if value in A2 is found in K2. Otherwise, it returns
FALSE. If you need it to be case sensitive, use FIND instead of SEARCH.


--
Hope that helps.

Vergel Adriano


"DaveM" wrote:

Hi all

If John Smith is in A2 How can I check that John Smith is in a sentence in
K2.

I have other names in Columns so I'm probably looking for a formula to place
in L2 then copy down column.

Thanks in advance

Dave





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Check for same Names in cells

try this formula in L2:

=IF(ISNUMBER(SEARCH(A2,K2,1)), TRUE, FALSE)


It will return TRUE if value in A2 is found in K2.


Since ISNUMBER returns TRUE or FALSE directly, you don't really need the IF
function call to repeat those results. This works exactly the same....

=ISNUMBER(SEARCH(A2,K2,1))

Rick

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Check for same Names in cells

You're right, Rick. I think I first had it say Found/Not Found then changed
it to True/False but didn't realize I no longer needed the IF function. For
the OP, you'll only need the IF function call if you want it to say something
other than True/False in the cell.

=IF(ISNUMBER(SEARCH(A2,K2,1)), "Found", "Not Found")


--
Hope that helps.

Vergel Adriano


"Rick Rothstein (MVP - VB)" wrote:

try this formula in L2:

=IF(ISNUMBER(SEARCH(A2,K2,1)), TRUE, FALSE)


It will return TRUE if value in A2 is found in K2.


Since ISNUMBER returns TRUE or FALSE directly, you don't really need the IF
function call to repeat those results. This works exactly the same....

=ISNUMBER(SEARCH(A2,K2,1))

Rick




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Check for same Names in cells

works fine

Thanks guys


"Vergel Adriano" wrote in message
...
You're right, Rick. I think I first had it say Found/Not Found then
changed
it to True/False but didn't realize I no longer needed the IF function.
For
the OP, you'll only need the IF function call if you want it to say
something
other than True/False in the cell.

=IF(ISNUMBER(SEARCH(A2,K2,1)), "Found", "Not Found")


--
Hope that helps.

Vergel Adriano


"Rick Rothstein (MVP - VB)" wrote:

try this formula in L2:

=IF(ISNUMBER(SEARCH(A2,K2,1)), TRUE, FALSE)


It will return TRUE if value in A2 is found in K2.


Since ISNUMBER returns TRUE or FALSE directly, you don't really need the
IF
function call to repeat those results. This works exactly the same....

=ISNUMBER(SEARCH(A2,K2,1))

Rick




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
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
Can I check names in one list agains names in another in excel? John@Hospice of Hope Excel Discussion (Misc queries) 1 August 22nd 06 09:24 AM
Check Box names Sharon Excel Programming 8 August 15th 06 03:01 PM
Referencing check box names in VBE jweasl Excel Programming 4 December 9th 05 12:45 AM
range names or check box ynissel Excel Worksheet Functions 7 August 23rd 05 03:11 AM


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