PC Review


Reply
Thread Tools Rate Thread

Check for same Names in cells

 
 
DaveM
Guest
Posts: n/a
 
      31st Aug 2007
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




 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      31st Aug 2007
> 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

 
Reply With Quote
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      31st Aug 2007
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
>
>
>
>
>

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      31st Aug 2007
> 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 With Quote
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      31st Aug 2007
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 With Quote
 
DaveM
Guest
Posts: n/a
 
      1st Sep 2007
works fine

Thanks guys


"Vergel Adriano" <(E-Mail Removed)> wrote in message
news:87AA4A56-FBED-4D10-BA69-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting email address names in a range of cells to real names John Microsoft Excel Worksheet Functions 1 19th May 2010 03:44 PM
Check 1 cells value and use the result to change another cells for BigAl Microsoft Excel Programming 1 23rd Dec 2008 08:09 AM
Can I check names in one list agains names in another in excel? =?Utf-8?B?Sm9obkBIb3NwaWNlIG9mIEhvcGU=?= Microsoft Excel Misc 1 22nd Aug 2006 09:24 AM
Check names feature not resolving names in Contacts =?Utf-8?B?Ymw=?= Microsoft Outlook Contacts 0 22nd Dec 2004 05:09 PM
Check Names and Select Names Outlook Worm Microsoft Outlook Form Programming 3 16th Sep 2004 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:42 AM.