If & Vlookup statement

S

Sarah

I am trying to lookup 2 separate ranges based on the IF statement.

For example If B3="PWR-PHYS" then I need it to lookup(A3,'DatePivot'!A1:B20,2)
But if B3 does not = "PWR-PHYS", then i need it to
lookup(A3,'Location'!A1:B20,2)

So whether it equals pwr-phys or doesnt, I need a value returned from
separate locations. Please advise how I can do this
 
G

Glenn

Sarah said:
I am trying to lookup 2 separate ranges based on the IF statement.

For example If B3="PWR-PHYS" then I need it to lookup(A3,'DatePivot'!A1:B20,2)
But if B3 does not = "PWR-PHYS", then i need it to
lookup(A3,'Location'!A1:B20,2)

So whether it equals pwr-phys or doesnt, I need a value returned from
separate locations. Please advise how I can do this


=VLOOKUP(A3,IF(B3="PWR-PHYS",'DatePivot'!A1:B20,'Location'!A1:B20),2)
 
G

Gary Brown

=if(B3="PWR-PHYS",lookup(A3,'DatePivot'!A1:B20,2),lookup(A3,'Location'!A1:B20,2))
 
M

Mitch

Try this and click yes if this works.

=IF(B3="PWR-PHYS",Vlookup(A3,'DatePivot'!A1:B20,2),vlookup(A3,'Location'!A1:B20,2))
 

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