Multiple vlookups in a nested if statement

Trabo86

New Member
Joined
Jul 22, 2018
Messages
2
I am trying to take a list of Product Numbers in Table 1 and put a Type description next to it based on which column the item number appears in a separate table. I can get the separate IF/Vlookup statements to work individually, but not all together.
Formula I'm using that doesn't work:
=IF(A3=VLOOKUP(A3,'Table 2'!$A$10:$A$11,1,FALSE),"PROMO",(IF(A3=VLOOKUP(A3,'Table 2'!$C$2:$C$16,1,FALSE),"BURNDOWN","STOCK")))

Example of data:

[TABLE="width: 202"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]Table 1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ProdNbr
[/TD]
[TD]Desc
[/TD]
[TD]Type[/TD]
[/TR]
[TR]
[TD]97609
[/TD]
[TD]Peanuts[/TD]
[TD]PROMO[/TD]
[/TR]
[TR]
[TD]97602[/TD]
[TD]Popcorn[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]97415[/TD]
[TD]Soda[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]97451A[/TD]
[TD]Licorice[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Table 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Promo[/TD]
[TD]Stock[/TD]
[TD]Burndown
[/TD]
[/TR]
[TR]
[TD]97609[/TD]
[TD]97602[/TD]
[TD]97415[/TD]
[/TR]
[TR]
[TD]97451A[/TD]
[TD]97425[/TD]
[TD]97599[/TD]
[/TR]
</tbody>[/TABLE]

Any help would be much appreciated!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi,

If I understand your description correctly, I don't think you need VLOOKUP for this.

One question thou, will there be instances where a Product Number in Table 1 has No match in Table 2 at all?


Book1
ABC
1Table 1
2ProdNbrDescType
397609PeanutsPROMO
497602PopcornSTOCK
597415SodaBURNDOWN
697451ALicoricePROMO
7
8
9Table 2
10PromoStockBurndown
11976099760297415
1297451A9742597599
Sheet139
Cell Formulas
RangeFormula
C3=IF(COUNTIF(A$11:A$12,A3),"PROMO",IF(COUNTIF(B$11:B$12,A3),"STOCK","BURNDOWN"))


C3 formula copied down.
 
Upvote 0

Book1
ABC
1ProdNbrDescType
297609PeanutsPromo
397602PopcornStock
497415SodaBurndown
599999mulberrynot available
697451ALicoricePromo
Sheet1



Book1
ABC
1PromoStockBurndown
2976099760297415
397451A9742597599
Sheet2


In C2 of Sheet1 control+shift+enter, not just enter, and copy down:

=IF(COUNTIFS(Sheet2!$A$2:$C$3,$A2),INDEX(Sheet2!$A$1:$C$1,MIN(IF(Sheet2!$A$2:$C$3=$A2,COLUMN(Sheet2!$A$1:$C$1)-COLUMN(Sheet2!$A$1)+1))),"not available")
 
Upvote 0
jtakw, To answer your question, there should not be a time where there is no match. I tried your formula and it worked beautifully! Thank you.

Aladin, I had trouble getting the array to work, but I'm good with the other formula. Thank you both very much.
 
Upvote 0
jtakw, To answer your question, there should not be a time where there is no match. I tried your formula and it worked beautifully! Thank you.

Aladin, I had trouble getting the array to work, but I'm good with the other formula. Thank you both very much.

See https://www.dropbox.com/s/qnlho79vang696o/Trabo86 type determination.xlsx?dl=0

Control+shift+enter; Press down the shift and the control keys at the same time while you hit the enter key. If done successfully, Excel itself puts a pair of { and } around the formula in recognition.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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