Alternative to long IFS

jackcolasu

New Member
Joined
Jan 16, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi!

I'm trying to search data from 1 table and input a corresponding value into another. I'm new to excel so I'm not very formular-savvy, and the solution I came up with is very long. I'm wondering if there is a shorter/faster alternative. I want the data from this table:
1737034487674.png


To move to this table:
1737034513490.png


The problem is, the data in table is constantly changing. Today "31" is in cell C5, but tomorrow it could be in cell F7. This is the formula I came up with that works but is long/clunky:
1737034629371.png

So for room 21, it's searching each cell from C5 to G5 to equal 21 and then returning B5 if true. If there is no true statement, it searches each cell from C6 to G6 to equal 21 and then returns B6 if true, and so on. I don't want to have to type and edit this formula for each room going down the list - is there a simpler way?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Can a patient bed gets assign to multiple people or exactly one person only?
 
Upvote 0
Hi & welcome to MrExcel.
How about in V4 copied down
Excel Formula:
=TOCOL(IF($C$5:$G$12=U4,$B$5:$B$12,1/0),2)
 
Upvote 0
Solution
A no formula solution that you can consider.

Use a Table
With a Table, you can sort:
sort smallest to largest assigned
sort by RN
sort by date
export to another range etc.

T202501a.xlsm
ABC
11DateRN_AssignedAssigned
1215-JanChristina21
1315-JanDana22
1415-JanLina23
1515-JanDana24
1615-JanAlana25
1715-JanShanis26
1815-JanAlana27
1915-JanChristina28
2015-JanChristina29
2115-JanChristina30
2215-JanLina31
2315-JanShanis32
2415-JanAlana33
2515-JanLina34
2615-JanShanis35
2715-JanLina36.1
2815-JanDana36.2
2915-JanShanis36.3
3015-JanDana36.4
3115-JanLina37.1
3215-JanChristina37.2
3315-JanShanis37.2
3415-JanDana37.3
35
5b
 
Upvote 0

Forum statistics

Threads
1,225,609
Messages
6,185,980
Members
453,333
Latest member
BioCoder84

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