Less cumbersome multiple lookup

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
Based on the data I have in col B, I am attempting to insert a code in col A. Any one of 4 different data items could be in col B.

Is there a formula that is less cumbersome than IF B=Water then A=Bottle or IF B=DAY then A=NIGHT etc... Any advise greatly appreciated!!

COL ACOL B
Formula = Bottle or NightCould be any of Water or Day

<tbody>
</tbody>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Is this what you have at the moment?
=IF(B1="Water","Bottle",IF(B1="Day","Night"))

Would it be better to use a VLOOKUP?
 
Last edited:
Upvote 0
You can also use a LOOKUP function:
Code:
=LOOKUP(B1,{[COLOR=#ff0000]"Day","Water"[/COLOR];"Night","Bottle"})
Add you can keep adding to that (you said that you have four possible values).
Just note that the values in red (the values you are matching on) must be in alphabetical order.
For more on the LOOKUP function, see: https://www.techonthenet.com/excel/formulas/lookup.php
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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