Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Combining IF with VLOOKUP

I am using Excel 2003. I would like to be able to lookup a value in a list.
What the lookup returns will be determined by whether or not there is an "X"
in one of the columns. For example, it will look up item 123 and if item
123 (in column A) has an "X" in the column beside it, the data returned
will be from columns C and D. If the item does not have an "X" in the
column beside it, the data returned will be from columns E and F. I am not
sure how to string together VLOOKUP with IF.

Thank you,

Ricki


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Combining IF with VLOOKUP

Hi,

First point is that in general you only return data from one column at a
time with VLOOKUP, not from column C and D at once.

The basic formula would be

=IF(VLOOKUP(A1,Sheet2!A1:F100,2,FALSE)="X",VLOOKUP (A1,Sheet2!A1:F100,3,FALSE),VLOOKUP(A1,Sheet2!A1:F 100,5,FALSE))

or a shorter variation:

=VLOOKUP(A1,Sheet2!A1:F100,IF(VLOOKUP(A1,Sheet2!A1 :F100,2,FALSE)="X",3,5),FALSE)

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

Cheers,
Shane Devenshire


"Ricki Miles" wrote:

I am using Excel 2003. I would like to be able to lookup a value in a list.
What the lookup returns will be determined by whether or not there is an "X"
in one of the columns. For example, it will look up item 123 and if item
123 (in column A) has an "X" in the column beside it, the data returned
will be from columns C and D. If the item does not have an "X" in the
column beside it, the data returned will be from columns E and F. I am not
sure how to string together VLOOKUP with IF.

Thank you,

Ricki



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Combining IF with VLOOKUP

Thank you, Shane. I will give it a try,

Ricki

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

First point is that in general you only return data from one column at a
time with VLOOKUP, not from column C and D at once.

The basic formula would be

=IF(VLOOKUP(A1,Sheet2!A1:F100,2,FALSE)="X",VLOOKUP (A1,Sheet2!A1:F100,3,FALSE),VLOOKUP(A1,Sheet2!A1:F 100,5,FALSE))

or a shorter variation:

=VLOOKUP(A1,Sheet2!A1:F100,IF(VLOOKUP(A1,Sheet2!A1 :F100,2,FALSE)="X",3,5),FALSE)

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

Cheers,
Shane Devenshire


"Ricki Miles" wrote:

I am using Excel 2003. I would like to be able to lookup a value in a
list.
What the lookup returns will be determined by whether or not there is an
"X"
in one of the columns. For example, it will look up item 123 and if item
123 (in column A) has an "X" in the column beside it, the data returned
will be from columns C and D. If the item does not have an "X" in the
column beside it, the data returned will be from columns E and F. I am
not
sure how to string together VLOOKUP with IF.

Thank you,

Ricki





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 Hlookup and vlookup Dale Excel Worksheet Functions 6 March 8th 14 12:48 AM
Is there any way of combining vlookup with getpivotdata? Sarah (OGI) Excel Worksheet Functions 1 April 10th 07 06:44 PM
VLOOKUP & Combining Worksheets - Please HELP ksverdlina Excel Worksheet Functions 0 March 13th 07 08:30 PM
Combining VLOOKUP functions Jay Excel Worksheet Functions 16 August 31st 06 06:52 PM
combining VLOOKUP and IF z.entropic Excel Worksheet Functions 4 January 24th 05 12:05 AM


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"