Simplifying a mammoth formula

JackieG63

New Member
Joined
Jan 9, 2020
Messages
6
Office Version
  1. 2010
Platform
  1. Windows
Hello, I'm afraid I'm self taught on Excel, therefore this formula is a monster.

I'm trying to put together a visual rota showing which nurses are on which duties at which times.

The HUGE formula I have put together returns VALUE, therefore I wondered if there is a simpler IF AND OR formula I could use, e.g. To return the result "Admin" is if X is between A and B or C and D or E and F.

Any help would be enormously appreciated.

=IF(AND(Q4>=$B5,Q4<$C5),"Admin"," "),IF(AND(Q4>=$C5,Q4<$D5),"Clinic"," "),IF(AND(Q4>=$D5,Q4<$E5),"Break"," "),IF(AND(Q4>=$E5,Q4<$F5),"Clinic"," "),IF(AND(Q4>=$F5,Q4<$G5),"Admin"," "),IF(AND(Q4>=$G5,Q4<$H5),"Clinic"," "),IF(AND(Q4>=$H5,Q4<$I5),"Break"," "),IF(AND(Q4>=$I5,Q4<$J5),"Clinic"," "),IF(AND(Q4>=$J5,Q4<$K5),"Admin"," ")

MondayAdminClinicBreakClinicAdminClinicBreakClinicAdminBreakFinish
07:30​
07:45​
08:00​
08:15​
08:30​
08:45​
09:00​
09:15​
09:30​
09:45​
Nurse 1
08:30​
08:40​
10:40​
11:00​
12:30​
13:30​
15:00​
15:10​
16:10​
16:30​
#VALUE!#VALUE!############
Nurse 2
08:30​
08:40​
10:40​
11:00​
12:30​
13:30​
15:00​
15:10​
16:10​
16:30​
Nurse 3
08:30​
08:40​
10:40​
11:00​
12:30​
13:30​
15:00​
15:10​
16:10​
16:30​
Nurse 4
08:30​
08:40​
10:40​
11:00​
12:30​
13:30​
15:00​
15:10​
16:10​
16:30​
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Perhaps:
=IF(OR(AND(Q4>=$B5,Q4<$C5),AND(Q4>=$F5,Q4<$G5),AND(Q4>=$J5,Q4<$K5)),"Admin",IF(OR(AND(Q4>=$C5,Q4<$D5),AND(Q4>=$E5,Q4<$F5),AND(Q4>=$G5,Q4<$H5),AND(Q4>=$I5,Q4<$J5)),"Clinic",IF(OR(AND(Q4>=$D5,Q4<$E5),AND(Q4>=$H5,Q4<$I5)),"Break","")))
 
Upvote 0
Hi,

Welcome to the Board.
Please test =INDEX($A$1:$K$1;MATCH(R1;B$5:K$5;1)).
 
Upvote 0
try this,

Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1
2
3
4MondayAdminClinicBreakClinicAdminClinicBreakClinicAdminBreakFinish7:307:458:008:158:308:459:0010:4512:3514:3015:3016:30
5Nurse 18:308:4010:4011:0012:3013:3015:0015:1016:1016:30    AdminClinicClinicBreakAdminClinicClinicBreak
6Nurse 28:308:4010:4011:0012:3013:3015:0015:1016:1016:30
7Nurse 38:308:4010:4011:0012:3013:3015:0015:1016:1016:30
8Nurse 48:308:4010:4011:0012:3013:3015:0015:1016:1016:30
Sheet3
Cell Formulas
RangeFormula
M5:X5M5=IFERROR(INDEX($B$4:$K$4,MATCH(M$4,$B5:$K5,1)),"")
 
Upvote 0
Thank you so much everyone.
I am sorted now and so very grateful for your time.
J
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

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