Using if statements and vlookups

bj6264

Board Regular
Joined
May 23, 2010
Messages
50
Hellom I'm trying to write a formula that says if a3=ap then lookup a certain range but if a3=br then lookup another range, can another help?
bj6264
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I think you're almost there.
You want something like this.
Code:
=if(a3="ap",[insert first lookup formula here],
if(a3="br",[insert second lookup formula here],
[specify what you want to do if a3 is neither "ap" nor "br"]))
 
Upvote 0
Hi, get an n/a answer. this is my formula
=IF(I1="ap",VLOOKUP(B3,Sheet1!$A$1:$C$14,3),IF(I1="br",VLOOKUP(B3,Sheet1!$D$1:$G$14,3),"0"))

the ap or br is a vlookup of b3 so will then use b3 for my lookup. Can you see anything obvious that I'm doing wrong?

bj6264
 
Upvote 0
Well one possibility is that it's not finding the B3 value in the relevant lookup range.

I'm not sure what you mean by this -
"ap or br is a vlookup of b3 so will then use b3 for my lookup"
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,239
Members
448,879
Latest member
VanGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top