IF, AND, VLOOKUP help

AESP920

New Member
Joined
Feb 7, 2005
Messages
48
Hello,

I am trying to do a If And with a vlookup within the same workbook.

IF(AND(IF(AF3431="Red",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),IF(AF3431="Blue",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),IF(AF3431="Green",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),IF(AF3431="Yellow",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),VLOOKUP(AF3431,'VLookup Table'!D:F,3,FALSE)))))="Other",AQ3431="500"),"Other Colors",IF(AF3431="Red",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),IF(AF3431="Blue",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),IF(AF3431="Green",VLOOKUP(AF3431="Yellow",VLOOKUP(AG3431,'VLookup Table'!E:F,2,FALSE),VLOOKUP(AF3431,'VLookup Table'!D:F,3,FALSE))))))

At the end of the day, if there is red, blue, green, or yellow in column AF, then I need to vlookup in a separate tab to columns E-F. But if there are none of these colors in column AF, then just vlookup D-F in the same Lookup table. Also if there is the word "Other" in AF but it has a 500 code in AQ, then I want it to say Other Colors.
Its giving me a #Value ! at the moment.

Thanks in advance,
Aesp
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
If I understand you correctly, replace your formula with this;

=IFERROR(IF(AND(AF3431="Other",AQ3431=500),"Other Colors",IF(OR(AF3431="red",AF3431="blue",AF3431="green",AF3431="yellow"),VLOOKUP(AG3431,'VLookup Table'!E:F,2,0),VLOOKUP(AF3431,'VLookup Table'!D:F,3,0))),"")
 
Upvote 0

Forum statistics

Threads
1,213,513
Messages
6,114,064
Members
448,545
Latest member
kj9

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