LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default OR Function in VLookup

=IF(ISNA(VLOOKUP(A2,A10:B14,2,FALSE)),VLOOKUP(B2, A10:B14,2,FALSE),VLOOKUP(A2,A10:B14,2,FALSE))

That can be reduced to:

=VLOOKUP(IF(COUNTIF(A10:A14,A2),A2,B2),A10:B14,2,0 )


--
Biff
Microsoft Excel MVP


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

I am not comfortable with the column 1 containing "A B", is that
really
what you have A followed by a bunch of spaces and then B?

If you have two values you want to check against the same table if the
first
one is not found then

Replace
=VLOOKUP(OR(A2,B2),A10:B14,2,FALSE)
With
=IF(ISNA(VLOOKUP(A2,A10:B14,2,FALSE)),VLOOKUP(B2,A 10:B14,2,FALSE),VLOOKUP(A2,A10:B14,2,FALSE))

or in 2007

=IFERROR(VLOOKUP(A2,A10:B14,2,FALSE),VLOOKUP(B2,A1 0:B14,2,FALSE))

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Biff" wrote:

Here is more detail:


A B C
1Column 1 Column 2 Return Value
2 A B 100

Table:

A B
10 Look Up Value Return Value
11 C 50
12 B 100
13 D 72
14 F 68

I am trying to get a formula that looks in both A2 and B2 for look up
value
when going to the table. It shouldn't find both values in the table.

The formual I used is: =VLOOKUP(OR(A2,B2),A10:B14,2,FALSE)

Help?

"xlm" wrote:

try using IF instead of OR. If you encounter any problem,
Post your database and your expected result in order
to eliminate guesswork.

HTH

--
If this posting was helpful, please click on the Yes button below

Thank You

cheers, francis









"Biff" wrote:

I am trying to embed an OR function in a VLookup function, but am
getting an
error message. Can someone help me out. I am trying to return a
value based
on a particular look up value, but if that lookup value doesn't
return
anything, I want it to look at another value in anothe adjacent cell.
I was
thinking that an OR function would solve this problem, but am having
troubles.

Thanks,
Biff





 
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
Embedded If Function in a Vlookup Function Excel Student Excel Worksheet Functions 2 January 13th 07 04:39 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
HOW DO I NEST THE VLOOKUP FUNCTION WITH THE LEFT FUNCTION CHAIM Excel Worksheet Functions 1 July 27th 05 09:10 PM
how do I write a vlookup function within an iserror function so t. JBLeeds Excel Worksheet Functions 2 March 16th 05 10:30 AM
I want to use Vlookup function and AND function in a single formu. prakash Excel Worksheet Functions 3 January 25th 05 07:11 AM


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