VLOOKUP & IF

S

Sarah

Hi All,

I am looking to use an if statement with 2 separate vlookups. Is this
possible? Basically what I want to do is if B3=PWRFUT then
lookup(A3,'FUT'!A1:C20,2)
However, if B3 does not equal PWRFUT then lookup(A3,'FX'!A1:C20,2)

Please help - thanks
 
E

Eduardo

Hi,
could you post an example of your data and the results you are looking for,
thanks
 
P

Pecoflyer

HOW TO GET FURTHER HELP WITH A WORKBOOK
For further help with it why not join our forums (shown i
the link below). It's completely free. If you do join you will have th
opportunity to add attachments to your posts so you can add workbooks t
better illustrate your problems and get help directly with them. Also i
you do join please post in this thread (link found below) so that peopl
who have been following or helping with this query can continue to d
so. :)
 
S

Sarah

Ok so below is my main information on my summary spreadsheet and the due date
column is where I need the formula to pull in.

deal_num Instrument Type Due Date
20732 PWR-EXCH-FUT 9/29/2009
20733 PWR-EXCH-FUT 10/7/2009
20734 PWR-EXCH-FUT 7/2/2009
21607 PWR-PHYS 7/20/2010
21608 PWR-PHYS 7/20/2010


Here is the information from the Futures spreadsheet, so If the instrument
type from above is equal to PWR-EXCH-FUT, then lookup the associated deal
number on the Futures spreadsheet and pull the event date into due date
column above

deal_tracking_num event_date
20732 9/29/2009
20733 10/7/2009
20734 7/2/2009
20735 7/2/2009
20736 7/6/2009

And here is the information from the FX spreadsheet for the 2nd vlookup, so
If the instrument type from above is not equal to PWR-EXCH-FUT, then lookup
the associated deal number in the FX spreadsheet and pull the event date into
due date column above

deal_tracking_num event_date
21589 1/20/2011
21607 7/20/2010
21608 7/20/2010
21609 7/20/2010
21618 1/20/2011
21619 1/20/2011
 
S

Sarah

Hi Jacob - that formula pulls in the date for anything that is PWRFUT, but if
B3 does not equal that, then its not looking up on the FX sheet. Everything
that isnt PWRFUT is feeding in as N/A
 
E

Eduardo

Hi,
try

=IF(B1="PWR-EXCH-FUT",INDEX(FUT!$B$2:$B$20,MATCH(A1,FUT!$A$2:$A$20,0)),INDEX(FX!$B$2:$B$20,MATCH(A1,FX!$A$2:$A$20,0)))
 
T

T. Valko

=IF(B3="PWRFUT",VLOOKUP(A3,FUT!A1:C20,2,0),VLOOKUP(A3,FX!A1:C20,2,0))

Another way to write that formula:

=VLOOKUP(A3,IF(B3="PWRFUT",FUT!A1:C20,FX!A1:C20),2,0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top