Need Index Match on dynamic sheet to return cell below match

Beeftank

New Member
Joined
Apr 9, 2015
Messages
8
Hello,

I am in the process of making a scheduling system for an orthopedic floor. View 2 is a sheet that is printed out for medical staff so they can see which times patients (by room number) have appointments with therapy. I used an index match to search and return times based on room numbers. This has worked great but per the feedback I received I also need initials to be shown.

In view 1 you can see room numbers are always listed in the first cell of a 3 cell block. Initials are always listed below the room number. To find appointment times based on room number for PT's I have used the formula below. In the formula, PT is defined dynamically in the name manager via a macro to accommodate the constant change of staff schedules (Person 1, Person 2, etc). A similar method was used for OT.

=INDEX('Current Schedule'!$A$4:$A$47,SMALL(IF(ISNUMBER(MATCH(PT,A5,0)),MATCH(ROW(PT),ROW(PT)),""),ROWS('Current Schedule'!$Z$1:$Z$1))) - This returns the appointment time for room 6103 for PT in View 2.

I know there are several ways to do this but I need help modifying or using a different formula that will find the specified room number across a dynamic set of columns and return the cell below it (initials). Can anyone offer me feedback on how I can accomplish this task? The problem I am running in to is the initials are below room numbers instead of next to them. Thank you!
 

Attachments

  • View 1.png
    View 1.png
    182.6 KB · Views: 9
  • View 2.png
    View 2.png
    58.3 KB · Views: 9

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
=INDEX('Current Schedule'!$A$4:$A$47,SMALL(IF(ISNUMBER(MATCH(PT,A5,0)),MATCH(ROW(PT),ROW(PT)),""),ROWS('Current Schedule'!$Z$1:$Z$1))) - This returns the appointment time for room 6103 for PT in View 2.

The formula above tells you what row 6103 is in (7:30 AM). Search the row that has 7:30 AM for the 6103 column and offset one row.

=INDEX(PT,MATCH(C5,'Current Schedule'!$A$4:$A$47,0)+1,MATCH(A5,INDEX(PT,MATCH(C5,'Current Schedule'!$A$4:$A$47,0),0),0))
 
Upvote 0
The formula above tells you what row 6103 is in (7:30 AM). Search the row that has 7:30 AM for the 6103 column and offset one row.

=INDEX(PT,MATCH(C5,'Current Schedule'!$A$4:$A$47,0)+1,MATCH(A5,INDEX(PT,MATCH(C5,'Current Schedule'!$A$4:$A$47,0),0),0))

Thank you AlphaFrog! This logic makes much more sense than my approach and solved an important problem. Thanks again :)
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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