Using if statements and vlookups

bj6264

New Member
Joined
May 23, 2010
Messages
49
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
 

Some videos you may like

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
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"]))
 

bj6264

New Member
Joined
May 23, 2010
Messages
49
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
 

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
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"
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,580
Messages
5,512,184
Members
408,884
Latest member
diggio

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top