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!!

[TABLE="class: grid, width: 500, align: right"]
<tbody>[TR]
[TD]COL A[/TD]
[TD]COL B[/TD]
[/TR]
[TR]
[TD]Formula = Bottle or Night[/TD]
[TD]Could be any of Water or Day[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,223,578
Messages
6,173,165
Members
452,504
Latest member
frankkeith2233

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