Return Value for Day of Week Interval based on Start / Stop time

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
119
Office Version
  1. 365
Platform
  1. Windows
Hi Brains trust,

I'm looking to build a formula in column E to do the following in the bottom table:

Look at the Day of week in column A (bottom table)
Find that day in the top table
Look at the time interval in column C (bottom table)
Is this time interval between the start / stop time for the corrosponding day in the top table
If yes - return 'staff per int' value
If no - leave cell blank

I've tried a combination of 'IF' + 'If(AND' + 'XLOOKUP' statements but I just can't get it right....



Book1
ABCDE
1DayStartStopStaff Per Int
2Mon08:00 AM08:00 PM20
3Tue08:00 AM08:00 PM20
4Wed08:00 AM08:00 PM20
5Thu08:00 AM08:00 PM20
6Fri08:00 AM08:00 PM20
7Sat09:00 AM06:00 PM5
8Sun
9
10Start Date Of Cycle:21/10/2022
11
12
13Fri21/10/202212:00 AM00:15
14Fri21/10/202212:15 AM00:15
15Fri21/10/202212:30 AM00:15
16Fri21/10/202212:45 AM00:15
17Fri21/10/202201:00 AM00:15
18Fri21/10/202201:15 AM00:15
19Fri21/10/202201:30 AM00:15
20Fri21/10/202201:45 AM00:15
21Fri21/10/202202:00 AM00:15
22Fri21/10/202202:15 AM00:15
23Fri21/10/202202:30 AM00:15
24Fri21/10/202202:45 AM00:15
25Fri21/10/202203:00 AM00:15
26Fri21/10/202203:15 AM00:15
27Fri21/10/202203:30 AM00:15
28Fri21/10/202203:45 AM00:15
29Fri21/10/202204:00 AM00:15
30Fri21/10/202204:15 AM00:15
31Fri21/10/202204:30 AM00:15
32Fri21/10/202204:45 AM00:15
33Fri21/10/202205:00 AM00:15
34Fri21/10/202205:15 AM00:15
35Fri21/10/202205:30 AM00:15
36Fri21/10/202205:45 AM00:15
37Fri21/10/202206:00 AM00:15
38Fri21/10/202206:15 AM00:15
39Fri21/10/202206:30 AM00:15
40Fri21/10/202206:45 AM00:15
41Fri21/10/202207:00 AM00:15
42Fri21/10/202207:15 AM00:15
43Fri21/10/202207:30 AM00:15
44Fri21/10/202207:45 AM00:15
45Fri21/10/202208:00 AM00:1520
46Fri21/10/202208:15 AM00:1520
47Fri21/10/202208:30 AM00:1520
48Fri21/10/202208:45 AM00:1520
49Fri21/10/202209:00 AM00:1520
50Fri21/10/202209:15 AM00:1520
51Fri21/10/202209:30 AM00:1520
52Fri21/10/202209:45 AM00:1520
53Fri21/10/202210:00 AM00:1520
54Fri21/10/202210:15 AM00:1520
55Fri21/10/202210:30 AM00:1520
56Fri21/10/202210:45 AM00:1520
57Fri21/10/202211:00 AM00:1520
58Fri21/10/202211:15 AM00:1520
59Fri21/10/202211:30 AM00:1520
60Fri21/10/202211:45 AM00:1520
61Fri21/10/202212:00 PM00:1520
62Fri21/10/202212:15 PM00:1520
63Fri21/10/202212:30 PM00:1520
64Fri21/10/202212:45 PM00:1520
65Fri21/10/202201:00 PM00:1520
66Fri21/10/202201:15 PM00:1520
67Fri21/10/202201:30 PM00:1520
68Fri21/10/202201:45 PM00:1520
69Fri21/10/202202:00 PM00:1520
70Fri21/10/202202:15 PM00:1520
71Fri21/10/202202:30 PM00:1520
72Fri21/10/202202:45 PM00:1520
73Fri21/10/202203:00 PM00:1520
74Fri21/10/202203:15 PM00:1520
75Fri21/10/202203:30 PM00:1520
76Fri21/10/202203:45 PM00:1520
77Fri21/10/202204:00 PM00:1520
78Fri21/10/202204:15 PM00:1520
79Fri21/10/202204:30 PM00:1520
80Fri21/10/202204:45 PM00:1520
81Fri21/10/202205:00 PM00:1520
82Fri21/10/202205:15 PM00:1520
83Fri21/10/202205:30 PM00:1520
84Fri21/10/202205:45 PM00:1520
85Fri21/10/202206:00 PM00:1520
86Fri21/10/202206:15 PM00:1520
87Fri21/10/202206:30 PM00:1520
88Fri21/10/202206:45 PM00:1520
89Fri21/10/202207:00 PM00:1520
90Fri21/10/202207:15 PM00:1520
91Fri21/10/202207:30 PM00:1520
92Fri21/10/202207:45 PM00:1520
93Fri21/10/202208:00 PM00:15
94Fri21/10/202208:15 PM00:15
95Fri21/10/202208:30 PM00:15
96Fri21/10/202208:45 PM00:15
97Fri21/10/202209:00 PM00:15
98Fri21/10/202209:15 PM00:15
99Fri21/10/202209:30 PM00:15
100Fri21/10/202209:45 PM00:15
101Fri21/10/202210:00 PM00:15
102Fri21/10/202210:15 PM00:15
103Fri21/10/202210:30 PM00:15
104Fri21/10/202210:45 PM00:15
105Fri21/10/202211:00 PM00:15
106Fri21/10/202211:15 PM00:15
107Fri21/10/202211:30 PM00:15
108Fri21/10/202211:45 PM00:15
109Sat22/10/202212:00 AM00:15
110Sat22/10/202212:15 AM00:15
111Sat22/10/202212:30 AM00:15
112Sat22/10/202212:45 AM00:15
113Sat22/10/202201:00 AM00:15
114Sat22/10/202201:15 AM00:15
115Sat22/10/202201:30 AM00:15
116Sat22/10/202201:45 AM00:15
117Sat22/10/202202:00 AM00:15
118Sat22/10/202202:15 AM00:15
119Sat22/10/202202:30 AM00:15
120Sat22/10/202202:45 AM00:15
121Sat22/10/202203:00 AM00:15
122Sat22/10/202203:15 AM00:15
123Sat22/10/202203:30 AM00:15
124Sat22/10/202203:45 AM00:15
125Sat22/10/202204:00 AM00:15
126Sat22/10/202204:15 AM00:15
127Sat22/10/202204:30 AM00:15
128Sat22/10/202204:45 AM00:15
129Sat22/10/202205:00 AM00:15
130Sat22/10/202205:15 AM00:15
131Sat22/10/202205:30 AM00:15
132Sat22/10/202205:45 AM00:15
133Sat22/10/202206:00 AM00:15
134Sat22/10/202206:15 AM00:15
135Sat22/10/202206:30 AM00:15
136Sat22/10/202206:45 AM00:15
137Sat22/10/202207:00 AM00:15
138Sat22/10/202207:15 AM00:15
139Sat22/10/202207:30 AM00:15
140Sat22/10/202207:45 AM00:15
141Sat22/10/202208:00 AM00:15
142Sat22/10/202208:15 AM00:15
143Sat22/10/202208:30 AM00:15
144Sat22/10/202208:45 AM00:15
145Sat22/10/202209:00 AM00:155
146Sat22/10/202209:15 AM00:155
147Sat22/10/202209:30 AM00:155
148Sat22/10/202209:45 AM00:155
149Sat22/10/202210:00 AM00:155
150Sat22/10/202210:15 AM00:155
151Sat22/10/202210:30 AM00:155
152Sat22/10/202210:45 AM00:155
153Sat22/10/202211:00 AM00:155
154Sat22/10/202211:15 AM00:155
155Sat22/10/202211:30 AM00:155
156Sat22/10/202211:45 AM00:155
157Sat22/10/202212:00 PM00:155
158Sat22/10/202212:15 PM00:155
159Sat22/10/202212:30 PM00:155
160Sat22/10/202212:45 PM00:155
161Sat22/10/202201:00 PM00:155
162Sat22/10/202201:15 PM00:155
163Sat22/10/202201:30 PM00:155
164Sat22/10/202201:45 PM00:155
165Sat22/10/202202:00 PM00:155
166Sat22/10/202202:15 PM00:155
167Sat22/10/202202:30 PM00:155
168Sat22/10/202202:45 PM00:155
169Sat22/10/202203:00 PM00:155
170Sat22/10/202203:15 PM00:155
171Sat22/10/202203:30 PM00:155
172Sat22/10/202203:45 PM00:155
173Sat22/10/202204:00 PM00:155
174Sat22/10/202204:15 PM00:155
175Sat22/10/202204:30 PM00:155
176Sat22/10/202204:45 PM00:155
177Sat22/10/202205:00 PM00:155
178Sat22/10/202205:15 PM00:155
179Sat22/10/202205:30 PM00:155
180Sat22/10/202205:45 PM00:155
181Sat22/10/202206:00 PM00:15
182Sat22/10/202206:15 PM00:15
183Sat22/10/202206:30 PM00:15
184Sat22/10/202206:45 PM00:15
185Sat22/10/202207:00 PM00:15
186Sat22/10/202207:15 PM00:15
187Sat22/10/202207:30 PM00:15
188Sat22/10/202207:45 PM00:15
189Sat22/10/202208:00 PM00:15
190Sat22/10/202208:15 PM00:15
191Sat22/10/202208:30 PM00:15
192Sat22/10/202208:45 PM00:15
193Sat22/10/202209:00 PM00:15
194Sat22/10/202209:15 PM00:15
195Sat22/10/202209:30 PM00:15
196Sat22/10/202209:45 PM00:15
197Sat22/10/202210:00 PM00:15
198Sat22/10/202210:15 PM00:15
199Sat22/10/202210:30 PM00:15
200Sat22/10/202210:45 PM00:15
201Sat22/10/202211:00 PM00:15
202Sat22/10/202211:15 PM00:15
203Sat22/10/202211:30 PM00:15
204Sat22/10/202211:45 PM00:15
205Sun23/10/202212:00 AM00:15
206Sun23/10/202212:15 AM00:15
207Sun23/10/202212:30 AM00:15
208Sun23/10/202212:45 AM00:15
209Sun23/10/202201:00 AM00:15
210Sun23/10/202201:15 AM00:15
211Sun23/10/202201:30 AM00:15
212Sun23/10/202201:45 AM00:15
213Sun23/10/202202:00 AM00:15
214Sun23/10/202202:15 AM00:15
215Sun23/10/202202:30 AM00:15
216Sun23/10/202202:45 AM00:15
217Sun23/10/202203:00 AM00:15
218Sun23/10/202203:15 AM00:15
219Sun23/10/202203:30 AM00:15
220Sun23/10/202203:45 AM00:15
221Sun23/10/202204:00 AM00:15
222Sun23/10/202204:15 AM00:15
223Sun23/10/202204:30 AM00:15
224Sun23/10/202204:45 AM00:15
225Sun23/10/202205:00 AM00:15
226Sun23/10/202205:15 AM00:15
227Sun23/10/202205:30 AM00:15
228Sun23/10/202205:45 AM00:15
229Sun23/10/202206:00 AM00:15
230Sun23/10/202206:15 AM00:15
231Sun23/10/202206:30 AM00:15
232Sun23/10/202206:45 AM00:15
233Sun23/10/202207:00 AM00:15
234Sun23/10/202207:15 AM00:15
235Sun23/10/202207:30 AM00:15
236Sun23/10/202207:45 AM00:15
237Sun23/10/202208:00 AM00:150
238Sun23/10/202208:15 AM00:150
239Sun23/10/202208:30 AM00:150
240Sun23/10/202208:45 AM00:150
241Sun23/10/202209:00 AM00:150
242Sun23/10/202209:15 AM00:150
243Sun23/10/202209:30 AM00:150
244Sun23/10/202209:45 AM00:150
245Sun23/10/202210:00 AM00:150
246Sun23/10/202210:15 AM00:150
247Sun23/10/202210:30 AM00:150
248Sun23/10/202210:45 AM00:150
249Sun23/10/202211:00 AM00:150
250Sun23/10/202211:15 AM00:150
251Sun23/10/202211:30 AM00:150
252Sun23/10/202211:45 AM00:150
253Sun23/10/202212:00 PM00:150
254Sun23/10/202212:15 PM00:150
255Sun23/10/202212:30 PM00:150
256Sun23/10/202212:45 PM00:150
257Sun23/10/202201:00 PM00:150
258Sun23/10/202201:15 PM00:150
259Sun23/10/202201:30 PM00:150
260Sun23/10/202201:45 PM00:150
261Sun23/10/202202:00 PM00:150
262Sun23/10/202202:15 PM00:150
263Sun23/10/202202:30 PM00:150
264Sun23/10/202202:45 PM00:150
265Sun23/10/202203:00 PM00:150
266Sun23/10/202203:15 PM00:150
267Sun23/10/202203:30 PM00:150
268Sun23/10/202203:45 PM00:150
269Sun23/10/202204:00 PM00:150
270Sun23/10/202204:15 PM00:150
271Sun23/10/202204:30 PM00:150
272Sun23/10/202204:45 PM00:150
273Sun23/10/202205:00 PM00:150
274Sun23/10/202205:15 PM00:150
275Sun23/10/202205:30 PM00:150
276Sun23/10/202205:45 PM00:150
277Sun23/10/202206:00 PM00:150
278Sun23/10/202206:15 PM00:150
279Sun23/10/202206:30 PM00:150
280Sun23/10/202206:45 PM00:150
281Sun23/10/202207:00 PM00:150
282Sun23/10/202207:15 PM00:150
283Sun23/10/202207:30 PM00:150
284Sun23/10/202207:45 PM00:150
285Sun23/10/202208:00 PM00:15
286Sun23/10/202208:15 PM00:15
287Sun23/10/202208:30 PM00:15
288Sun23/10/202208:45 PM00:15
289Sun23/10/202209:00 PM00:15
290Sun23/10/202209:15 PM00:15
291Sun23/10/202209:30 PM00:15
292Sun23/10/202209:45 PM00:15
293Sun23/10/202210:00 PM00:15
294Sun23/10/202210:15 PM00:15
295Sun23/10/202210:30 PM00:15
296Sun23/10/202210:45 PM00:15
297Sun23/10/202211:00 PM00:15
298Sun23/10/202211:15 PM00:15
299Sun23/10/202211:30 PM00:15
300Sun23/10/202211:45 PM00:15
Sheet1
Cell Formulas
RangeFormula
A13:A300A13=TEXT(B13,"ddd")
B13B13=D10
B14:B108,B110:B204,B206:B300B14=B13
B109,B205B109=B108+1
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
In E13:
If return blank where 0:
Code:
=IFERROR(1/1/(C13+10^-10=INDEX(MEDIAN(C13+10^-10,VLOOKUP(A13,$A$2:$D$7,{2,3},0)),))*VLOOKUP(A13,$A$2:$D$7,4,0),"")
If returns 0:
Code:
=IFERROR((C13+10^-10=INDEX(MEDIAN(C13+10^-10,VLOOKUP(A13,$A$2:$D$7,{2,3},0)),))*VLOOKUP(A13,$A$2:$D$7,4,0),"")
 
Upvote 0
Solution
In E13:
If return blank where 0:
Code:
=IFERROR(1/1/(C13+10^-10=INDEX(MEDIAN(C13+10^-10,VLOOKUP(A13,$A$2:$D$7,{2,3},0)),))*VLOOKUP(A13,$A$2:$D$7,4,0),"")
If returns 0:
Code:
=IFERROR((C13+10^-10=INDEX(MEDIAN(C13+10^-10,VLOOKUP(A13,$A$2:$D$7,{2,3},0)),))*VLOOKUP(A13,$A$2:$D$7,4,0),"")

Cheers bebo - exactly what I was after :)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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