Multiple VLOOKUP Nested with AND Statement

anbarblue

New Member
Joined
Jun 5, 2012
Messages
8
Hi All!

I've been working on this all day! <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
I am able to get the following two formulas to work independently, but not together… I know I’m missing something, but I cannot figure out what. <o:p></o:p>
<o:p></o:p>
Here is my pseudocode: If (x= blank, do a vlookup on sheet1, otherwise return x) but if v = “a”, “b”, “c”, “d”, then do a vlookup on sheet2 instead) <o:p></o:p>
<o:p></o:p>
1.=IF(AA1303="",VLOOKUP(T1303,'MB'!F:G,2,0),AA1303)<o:p></o:p>
2.=(VLOOKUP(V1303,'Eastern&Western.Overlap'!A:B,IF(R1303="MINC",2,IF(R1303="RAYASS",2,IF(R1303="RAYJAMES",2,IF(R1303="CAPMKTS",2,IF(R1303="ML",2,FALSE)))))))

Thanks!!!
 
Good Morning!
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Back to this excel... <o:p></o:p>
<o:p></o:p>
Here is hopefully a clearer pseudo code. <o:p></o:p>
<o:p></o:p>
if x=blank, then vlookup dealername in sheet1, and return salesman. If dealername is not found in sheet 1, then look for the name in sheet2 and return salesman. <o:p></o:p>
<o:p></o:p>
If x <> blank, then return x.<o:p></o:p>
<o:p></o:p>
I appreciate it! I'm usually pretty good at figuring these out, but I'm stuck on this one.<o:p></o:p>
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
if x=blank, then vlookup dealername in sheet1, and return salesman. If dealername is not found in sheet 1, then look for the name in sheet2 and return salesman.

If x <> blank, then return x.

I would say something along the lines of =IF(x="",IFERROR(VLOOKUP(dealername,sheet1reference,col_number,0),VLOOKUP(dealername,sheet2reference,col_number,0)),x)
 
Upvote 0
Thanks. I'm going to give it a try.

Same formula, but a diversion for a moment… how do I minimize the IF statements that are all the same as mentioned by T. I tried doing an AND statement, I kept getting errors. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p> </o:p>
IF(R1303="RAYASS",2,IF(R1303="RAYJAMES",2,IF(R1303="CAPMKTS",2,IF(R1303="ML",2,)<o:p></o:p>
 
Upvote 0
=IF((R1303="RAYASS")+(R1303="RAYJAMES")+(R1303="CAPMKTS")+(R1303="ML"),2)

which will return FALSE if none of the conditions are met.
 
Upvote 0
I would say something along the lines of =IF(x="",IFERROR(VLOOKUP(dealername,sheet1reference,col_number,0),VLOOKUP(dealername,sheet2reference,col_number,0)),x)
This worked like a charm... I never thought of the "IsError"; :)

Thanks Ben!!! (Do I need to do something on here after there is a solution?)
 
Upvote 0
Actually it's IFERROR - ISERROR just returns true or false.

And no, but don't worry - once your reply count hits a certain number no one looks at it anyways! ;)

Anyway, glad I could help (y) Appreciate the feedback!
 
Upvote 0

Forum statistics

Threads
1,217,013
Messages
6,134,025
Members
449,853
Latest member
kaitlynmwb

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