VLOOKUP query

thewiseguy

Well-known Member
Joined
May 23, 2005
Messages
954
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I have a VLOOKUP which is working just fine. However, I need to add another function to this formula and I'm not sure if it can be done through a VLOOKUP.

Lets call the existing VLOOKUP, VLOOKUP-A.
I am going to add a VLOOKUP, called VLOOKUP-B.

I want my formula to look into cell A1 and if the value is "T" then I want to use VLOOKUP-A.
If the value in A1 is "W" then I want to use VLOOKUP-B.

I hope this is clear and any help is greatly appreciated.


-twg
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Should be simple enough!
Code:
=IF(A1="T",VLOOKUP-A,VLOOKUP-B)

lenze

hi lenze...i dont think i worded my issue correctly. when i say "VLOOKUP-A" and VLOOKUP-B" i mean that those formulas already have variables in them.

Here is VLOOKUP-A:

=IF(ISERROR(VLOOKUP(B10,WHOLE,7,FALSE)),"",VLOOKUP(B10,WHOLE,7,FALSE))

VLOOKUP -B is going to be:

=IF(ISERROR(VLOOKUP(B10,WHOLE,8,FALSE)),"",VLOOKUP(B10,WHOLE,8,FALSE))

So when cell A1 = "T", i want my active cell to return the formula in VLOOKUP-A
when cell A1 = "W" I want my active cell to return the formula in VLOOKUP-B
 
Upvote 0
So:
Code:
=IF(A1="T",IF(ISERROR(VLOOKUP(B10,WHOLE,7,FALSE)),"",VLOOKUP(B10,WHOLE,7,FALSE)),IF(ISERROR(VLOOKUP(B10,WHOLE,8,FALSE)),"",VLOOKUP(B10,WHOLE,8,FALSE)))

lenze
 
Upvote 0
So:
Code:
=IF(A1="T",IF(ISERROR(VLOOKUP(B10,WHOLE,7,FALSE)),"",VLOOKUP(B10,WHOLE,7,FALSE)),IF(ISERROR(VLOOKUP(B10,WHOLE,8,FALSE)),"",VLOOKUP(B10,WHOLE,8,FALSE)))

lenze

THX lenze, that worked perfectly!
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,374
Members
448,888
Latest member
Arle8907

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