Using MID w/ IF

Rembrandt7

New Member
Joined
Jan 18, 2017
Messages
3
I am trying to use mid with if, I tried nest IF, but that didn't work. I am using the following it work but will not give me the response I need.

=LOOKUP(MID(ROOM_NUMBER,2,1)+0,1,"1st Floor")


[TABLE="width: 45"]
<tbody>[TR]
[TD]ROOM_NUMBER[/TD]
[TD]FLOOR[/TD]
[/TR]
[TR]
[TD][TABLE="width: 227"]
<tbody>[TR]
[TD]N1017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]=LOOKUP(MID(ROOM_NUMBER,2,1)+0,1,"1st Floor")[/TD]
[/TR]
[TR]
[TD][TABLE="width: 227"]
<tbody>[TR]
[TD]N1047[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
First, is ROOM_NUMBER a named range and second, what are you trying to do exactly?
 
Upvote 0
you haven't told us what you want to output

Room_number - is that a named range
or the column

explain the data structure and what output you would like
 
Upvote 0
If it is a named range, this is my guess of what you want:
=MID(ROOM_NUMBER,2,1) & LOOKUP(MID(ROOM_NUMBER,2,1)+0,{1,2,3,4},{"st","nd","rd","th"}) & " Floor"

or a littler shorter:

=MID(ROOM_NUMBER,2,1) & CHOOSE(MIN(MID(ROOM_NUMBER,2,1),4),"st","nd","rd","th")&" Floor"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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