PC Review


Reply
Thread Tools Rate Thread

check to see if a list of cells contains a string

 
 
wing328hk@gmail.com
Guest
Posts: n/a
 
      27th May 2007
Hi,

Is there a function to check if a list of cells (say form a1 to a10)
contains a string in a cell (say b2)??

I try lookup and the problem of lookup is that even though b2 is not
in a1 to 10, it returns the previous result instead of N/A.

Thanks,
wing

 
Reply With Quote
 
 
 
 
Niek Otten
Guest
Posts: n/a
 
      27th May 2007
Use VLOOKUP() instead of LOOKUP().
To find an exact match, the fourth argument of VLOOKUP() should be FALSE

--
Kind regards,

Niek Otten
Microsoft MVP - Excel



<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
| Hi,
|
| Is there a function to check if a list of cells (say form a1 to a10)
| contains a string in a cell (say b2)??
|
| I try lookup and the problem of lookup is that even though b2 is not
| in a1 to 10, it returns the previous result instead of N/A.
|
| Thanks,
| wing
|


 
Reply With Quote
 
=?Utf-8?B?QWRhbVY=?=
Guest
Posts: n/a
 
      27th May 2007
If you only want to know if it does contain that string (or maybe where the
match occurs), use MATCH rather than a lookup.

eg =MATCH(B2,A1:A10,0) will return "5" if the item in B2 is in A5 (the fifth
position in the searched list).

So =NOT(ISERROR(MATCH(B2,A1:A10,0)) will produce "True" if it is in the list
and "false" if not.
--
Adam Vero
MCP, MOS Master, MLSS, CWNA
http://veroblog.wordpress.com
http://www.meteorit.co.uk


"(E-Mail Removed)" wrote:

> Hi,
>
> Is there a function to check if a list of cells (say form a1 to a10)
> contains a string in a cell (say b2)??
>
> I try lookup and the problem of lookup is that even though b2 is not
> in a1 to 10, it returns the previous result instead of N/A.
>
> Thanks,
> wing
>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      27th May 2007
Instead of:
=NOT(ISERROR(MATCH(B2,A1:A10,0))

you could also use:
=isnumber(MATCH(B2,A1:A10,0)



AdamV wrote:
>
> If you only want to know if it does contain that string (or maybe where the
> match occurs), use MATCH rather than a lookup.
>
> eg =MATCH(B2,A1:A10,0) will return "5" if the item in B2 is in A5 (the fifth
> position in the searched list).
>
> So =NOT(ISERROR(MATCH(B2,A1:A10,0)) will produce "True" if it is in the list
> and "false" if not.
> --
> Adam Vero
> MCP, MOS Master, MLSS, CWNA
> http://veroblog.wordpress.com
> http://www.meteorit.co.uk
>
> "(E-Mail Removed)" wrote:
>
> > Hi,
> >
> > Is there a function to check if a list of cells (say form a1 to a10)
> > contains a string in a cell (say b2)??
> >
> > I try lookup and the problem of lookup is that even though b2 is not
> > in a1 to 10, it returns the previous result instead of N/A.
> >
> > Thanks,
> > wing
> >
> >


--

Dave Peterson
 
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
RE: Check cells for validation list StumpedAgain Microsoft Excel Programming 0 25th Jul 2008 05:21 PM
RE: Check cells for validation list Gary''s Student Microsoft Excel Programming 3 25th Jul 2008 04:22 PM
Search string in cells for a criteria in a list VBA Noob Microsoft Excel Programming 0 1st May 2006 09:35 PM
Best way to check is a string is in a list? Gerrit Beuze Microsoft C# .NET 5 20th Jun 2005 11:37 PM
check to see if cell contains a string = to member of list NikkoW Microsoft Excel Programming 1 1st May 2004 11:40 PM


Features
 

Advertising
 

Newsgroups
 


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