Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default Identify if the result contains a particular value

Hi,

VLOOKUP supports wildcards, so if you replace $A3 with

"*"&$A3&"*"

you have "contains"

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Sarah (OGI)" wrote:

I've got the following formula:

=IF(VLOOKUP($A3,Lookup!$A:$K,9,FALSE))=16,"Yes","N o")

However, I'd like the formula to now see if the result of the vlookup
contains (not equals) a particular value, i.e. if the returned value contains
'16', I want to show "Yes", otherwise "No".

A vlookup might not even be the right function for this, so any help would
be appreciated.

Many thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Identify if the result contains a particular value

see if the result of the vlookup contains (not equals)
a particular value, i.e. if the returned value contains
'16', I want to show "Yes", otherwise "No".


Try this:

=IF(COUNT(FIND(16,VLOOKUP($A3,Lookup!$A:$K,9,0))), "Yes","No")


--
Biff
Microsoft Excel MVP


"Shane Devenshire" wrote in
message ...
Hi,

VLOOKUP supports wildcards, so if you replace $A3 with

"*"&$A3&"*"

you have "contains"

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Sarah (OGI)" wrote:

I've got the following formula:

=IF(VLOOKUP($A3,Lookup!$A:$K,9,FALSE))=16,"Yes","N o")

However, I'd like the formula to now see if the result of the vlookup
contains (not equals) a particular value, i.e. if the returned value
contains
'16', I want to show "Yes", otherwise "No".

A vlookup might not even be the right function for this, so any help
would
be appreciated.

Many thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Identify if the result contains a particular value


You've gotten good counsel- Shane's method of doing wildcard matches
will work if the VLookup leftmost column of the lookup table array is
text or numbers stored as text, and if the col index number is 1. I'll
keep that trick in my back pocket...

Biff's use of Count to deal with the fact that FIND will generate an
error if it doesn't find the string is neat - I'd always used the
ISERROR() function to catch that condition, so I'll remember that, too.

One thing no one has mentioned - which may not apply - is to be
cautious if you are dealing with values other than integers -
15.9999999999 will look like 16 in any rationally formatted cell, but
will generate an apparent error because the formula will evaluate to No.
On the other hand, 1783.34916 will evaluate to "yes" when you might not
expect it to. If you are pulling data in from some other source or
depending on user input, the use of the ROUND function might be
appropriate...


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=111753

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
excel result return wrong calcuation result garyww Excel Worksheet Functions 1 August 14th 06 11:14 AM
excel result return wrong calcuation result garyww Excel Worksheet Functions 0 August 14th 06 05:02 AM
Advanced formula - Return result & Show Cell Reference of result Irv Excel Worksheet Functions 7 May 6th 06 03:36 AM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM
How identify data of two coulams,Every cell count and show result pooja Excel Discussion (Misc queries) 1 September 19th 05 09:51 AM


All times are GMT +1. The time now is 09:43 PM.

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"