Returning an absolute value if the numbers in a cell are between ______ and ______.

Helener

New Member
Joined
Feb 23, 2009
Messages
18
I hope I can explain myself. I have a spreadsheet that lists room numbers in a hospital. The room numbers in this facility have corresponding unit numbers (i.e. rooms 103 to 133 are considered Unit A1, rooms 203 to 233 are considered Unit A2 and rooms 303 to 333 are Unit A3). My spreadsheet is set up with the Unit name in Column F and the Room number in Column G. The Unit number is blank, as my download from another program will list room number only and not Unit number. I would like the formula to reference the room number in column G and return the corresponding Unit Number in Column F. My problem is as follows, the Room Nmbers have letters next to them (i.e. Room 108D, 328P or 215A). Is there a way to have the formula return the absolute value of A1 for rooms 103-133 even if there is a letter next to some of the room numbers? Any help is greatly appreciated. Thanks.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
couple of questions:

- do all rooms have 3-digit numbers?
- do you only have 3 Units A1-Ax or are there also Units B1-Bx?
- how do Room numbers and Units corellate?
 
Upvote 0
Thanks for your reply. All rooms have 3 digit numbers. There are 2 Buildings, Building A which houses Units A1, A2 and A3 and Building B which houses Units B1, B2, B3 and B4. Unit A's room numbers are listed below. Unit B's rooms are Rooms 140 to 168 are on Unit B1, rooms 240 to 268 are on Unit B2, Rooms 340 to 368 are on Unit B3 and rooms 440 to 468 are on Unit B4. Does this help?
 
Upvote 0
I hope I can explain myself. I have a spreadsheet that lists room numbers in a hospital. The room numbers in this facility have corresponding unit numbers (i.e. rooms 103 to 133 are considered Unit A1, rooms 203 to 233 are considered Unit A2 and rooms 303 to 333 are Unit A3). My spreadsheet is set up with the Unit name in Column F and the Room number in Column G. The Unit number is blank, as my download from another program will list room number only and not Unit number. I would like the formula to reference the room number in column G and return the corresponding Unit Number in Column F. My problem is as follows, the Room Nmbers have letters next to them (i.e. Room 108D, 328P or 215A). Is there a way to have the formula return the absolute value of A1 for rooms 103-133 even if there is a letter next to some of the room numbers? Any help is greatly appreciated. Thanks.
Try this...

="A"&MATCH(--LEFT(A1,3),{103,203,303})
 
Upvote 0
try:
Excel Workbook
AB
2UnitRoom nr
3A1103
4B1156
5A1133
6A1128
7A2233
8A2203
9B2268
10B2240
Tabelle2
Cell Formulas
RangeFormula
A3=IF(AND(VALUE(MID(B3,2,2))>=3,VALUE(MID(B3,2,2))<=33),"A","B")&LEFT(B3,1)
A4=IF(AND(VALUE(MID(B4,2,2))>=3,VALUE(MID(B4,2,2))<=33),"A","B")&LEFT(B4,1)
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

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