Look-up Formula Logic Update

bdav1216

New Member
Joined
Mar 19, 2016
Messages
37
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have the following look-up formula:

=IFERROR((VLOOKUP(AG2,Sheet2!$L$2:$M$617,2,0)),"N/A")

I would like to add a condition to this formula that says:

IF Column BD = Hello, then return a value of "MK" regardless of the look-up value.

Essentially, this logic should override the value returned from the look-up table

**

If there's a way to modify the look-up table to accommodate this to avoid updating the formula, that would also make sense and would be my preferred solution.

How would the above formula be updated to evaluate a 3rd column?

Currently when AG2 in Sheet1 matches Column L of Sheet2, the value of Column M is returned.

Is there a way to add Column K in the lookup? Basically, when Column K is populated, that is the value that should be evaluated. If it is blank, use the current Column L.

Sheet 2 Current:

Column L Column M
West ABC
South XYZ
North EFG

Sheet 2 Proposed:

Column K Column L Column M
West ABC
South XYZ
North EFG
Hello East MK
Bye West MK
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
The simplest way is to modify the formula like
=IF(BD2="Hello","MK",IFERROR(VLOOKUP(AG2,Sheet2!$L$2:$M$617,2,0),"N/A"))
 
Upvote 0
The simplest way is to modify the formula like
=IF(BD2="Hello","MK",IFERROR(VLOOKUP(AG2,Sheet2!$L$2:$M$617,2,0),"N/A"))

Thank you. The formula does work so very helpful.

If I had more than 1 value other than "Hello", how would I update?

For example:
If the value in Column BD = "Hello", override lookup to output a "MK"
If the value in Column BD = "Bye", override lookup to output a "SH"
If the value in Column BD = "NO", override lookup to output a "JP"
 
Upvote 0
How about
=IFERROR(INDEX({"SH","MK","JP"},MATCH(B2,{"Bye","Hello","NO"},0)),IFERROR(VLOOKUP(AG2,Sheet2!$L$2:$M$617,2,0),"N/A"))
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

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