Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default "If" statement with Vlookup

I have three columns that I need to lookup and if the first column is met
then " " for the other two columns. If first column is null then lookup
column B and if B is null lookup column C. A result should show up for only 1
column. I am having difficulty writing the formula without getting errors.
Please help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default "If" statement with Vlookup

Indicatively it should look like this:
=if(isna(vlook1),if(isna(vlook2),if(isna(vlook3)," ",vlook3),vlook2),vlook1)

Here are 2 actual examples, all in one cell (shown indented for clarity):

If you mean lookup the same value (A3) in 3 different sheets:
Sheet2, Sheet3 & Sheet4 (in this sequence):

=IF(ISNA(VLOOKUP(A3,Sheet2!A:B,2,0)),
IF(ISNA(VLOOKUP(A3,Sheet3!A:B,2,0)),
IF(ISNA(VLOOKUP(A3,Sheet4!A:B,2,0)),"",
VLOOKUP(A3,Sheet4!A:B,2,0)),
VLOOKUP(A3,Sheet3!A:B,2,0)),
VLOOKUP(A3,Sheet2!A:B,2,0))


If you mean lookup 3 different values (A3,B3,C3 - in this sequence) in the
same sheet (Sheet2):

=IF(ISNA(VLOOKUP(A3,Sheet2!A:B,2,0)),
IF(ISNA(VLOOKUP(B3,Sheet2!A:B,2,0)),
IF(ISNA(VLOOKUP(C3,Sheet2!A:B,2,0)),"",
VLOOKUP(C3,Sheet2!A:B,2,0)),
VLOOKUP(B3,Sheet2!A:B,2,0)),
VLOOKUP(A3,Sheet2!A:B,2,0))

p/s: For unmatched instances, I'd use blanks: ""
as the return, rather than a space: " "

Above any good? hit the YES below
--
Max
Singapore
xde
---
"Nikki" wrote:
I have three columns that I need to lookup and if the first column is met
then " " for the other two columns. If first column is null then lookup
column B and if B is null lookup column C. A result should show up for only 1
column. I am having difficulty writing the formula without getting errors.
Please help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 135
Default "If" statement with Vlookup

Nikki -

You didn't give us much information to go on. I assume you have 3 columns
with data, columns A, B, and C. I also assume you have a value you are
trying to lookup, say it is in cell E2. When you say column A is null, I
assume you mean that the value in cell E2 is not in you data in column A,
etc. If this is the case, then your formula will be something like this (you
will need to change the row numbers to match your ranges):

=IF(ISNA(VLOOKUP(E2,A4:A11,1,FALSE)),IF(ISNA(VLOOK UP(E2,B4:B11,1,FALSE)),IF(ISNA(VLOOKUP(E2,C4:C11,1 ,FALSE)),"Not
Found",VLOOKUP(E2,C4:C11,1,FALSE)),VLOOKUP(E2,B4:B 11,1,FALSE)),VLOOKUP(E2,A4:A11,1,FALSE))

--
Daryl S


"Nikki" wrote:

I have three columns that I need to lookup and if the first column is met
then " " for the other two columns. If first column is null then lookup
column B and if B is null lookup column C. A result should show up for only 1
column. I am having difficulty writing the formula without getting errors.
Please help.

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
Combining "IF"statement with "Vlookup" Malcolm McMaster[_2_] Excel Discussion (Misc queries) 9 October 21st 14 03:13 AM
correct syntax for nesting "if", "and", and "vlookup"....if possib Christine Excel Worksheet Functions 4 January 2nd 09 10:43 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
vlookup if statement returning a "false" answer. inthestands Excel Worksheet Functions 2 September 20th 07 11:36 PM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM


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