ISBLANK formula not working!!

hoyos

Board Regular
Joined
Jul 10, 2012
Messages
98
Office Version
  1. 365
Platform
  1. Windows
I’m trying to get the formula below to work but having no luck. It should flag up if after a run of three night shift (18:00pm to 03:00am) if I enter a start time for a new shift anytime under 34 hours after the end of the last night shift.

R11
if( ISBLANK(D11) = TRUE,"",IF(D13<>Sheet1!$A$2,(IF(IF(AND(D10=Sheet1!$A$2,D11=Sheet1!$A$2,D12=Sheet1!$A$2),1,0) = 1,"Blank",IF(AND(D9=Sheet1!$A$2,D10=Sheet1!$A$2,D11=Sheet1!$A$2),IF(D13 <= E11 + TIME(34,0,0),"No","Sure"),"Blank2"))),(IF(IF(AND(D10=Sheet1!$A$2,D11=Sheet1!$A$2,D12=Sheet1!$A$2),1,0) = 1,"No","Yes"))))

Sheet1!$A$2 is populated with the shift start time of 18:00 as a reference.
Column D= start time of shift
Column C= end time of shift
Column R= formula

Any help would be appreciated
 
What do you have in AF16 and AF18?

There is other missing data but I don't think that it will affect the formulas that are needed for the question.
AF16 is starting date and AF18 is the number of the period.
Each period has 28 days and over one year there are 13 periods. There is a couple of buttons which starts a new period or backwards to view previous periods. They shouldn't affect the formulas.
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try this in R6 and fill down.
Excel Formula:
=IFERROR(IF(D6="","",IF(COUNTIF(D2:D5,0.75)=3,IF(SUM(C6:D6,-INDEX(C2:E5,MATCH(1E+100,D2:D5),{1,3}))<--"34:00:00","NO","YES"),"")),"")
 
Upvote 0
Try this in R6 and fill down.
Excel Formula:
=IFERROR(IF(D6="","",IF(COUNTIF(D2:D5,0.75)=3,IF(SUM(C6:D6,-INDEX(C2:E5,MATCH(1E+100,D2:D5),{1,3}))<--"34:00:00","NO","YES"),"")),"")
Hi Jason, doesn’t quite working! Need to account if the row above is blank. ie if you look at row 17 it’s showing “yes” until I populate row 16 then it indicates “no”. After a run of three night duties you will always have a blank row. Hope that helps.
 
Upvote 0
if you look at row 17 it’s showing “yes”
Why is that wrong? You gave a very unclear explanation, it was my interpretation that it should be "NO" if it was less than 34 hours, or "YES" if it was more than 34 hours.
With the example you give above, there is a difference of 36 hours.
 
Upvote 0
Why is that wrong? You gave a very unclear explanation, it was my interpretation that it should be "NO" if it was less than 34 hours, or "YES" if it was more than 34 hours.
With the example you give above, there is a difference of 36 hours.
I apologise for the confusion, having finished on the third night I must have at least 34 hours free of duty from what ever time I finish on the third night. For example:
If I finish at 03:00am on the 15th I can’t start a shift till 13:00pm on the 17th.
Or if I finish at 05:00am on the 15th I can’t start a new shift till 15:00pm on the 17th.
 
Upvote 0
You still haven't answered my question. Why is "Yes" wrong on the row that you queried? There is a gap of more than 34 hours so as far as I can see, the result shown is correct.
 
Upvote 0
If you look at row 17 it's indicating "yes" where it should show "no" as the start time is well before the 34 hours allowed.

FTL Matt Wilcock_New edition 10.xlsm
ABCDEFGHIJKLMNOPQRS
3DUTY HOURSFLYING HOURSOFFHave I had 2 off consec in 14More then 4 lates in 7More then 3 consec lates34hrs off after late finish before early shift
4Day NoDayDateDuty Period28 Day Total7 Day TotalFlight Times28 Day Total7 Day Total14 Day TotalDuty / Remarks
5StartFinishHoursFirst T/OLast LdgFly Hrs
61Wed21-Sep18:0003:009:00171:0057:000:000:004433 HEMS Late
72Thu22-Sep171:0057:000:000:005533 OFF
83Fri23-Sep171:0047:000:000:006633 OFF
94Sat24-Sep161:0037:000:000:007733 OFF
105Sun25-Sep08:0018:0010:00161:0037:000:000:007733 HEMS Early
116Mon26-Sep08:0018:0010:00161:0038:000:000:006622 HEMS Early
127Tue27-Sep08:0018:0010:00162:0039:000:000:005511 HEMS Early
138Wed28-Sep18:0003:009:00162:0057:000:000:004411 HEMS Late
149Thu29-Sep18:0003:009:00162:0048:000:000:003322 HEMS Late
1510Fri30-Sep18:0003:009:00171:0057:000:000:003333 HEMS Late
1611Sat1-Oct171:0057:000:000:003333 
1712Sun2-Oct08:0018:0010:00181:0057:000:000:003333YESHEMS Early
1813Mon3-Oct181:0047:000:000:004433 OFF
1914Tue4-Oct171:0037:000:000:005533 OFF
2015Wed5-Oct08:0018:0010:00171:0038:000:000:005522 HEMS Early
2116Thu6-Oct08:0018:0010:00171:0039:000:000:004411 HEMS Early
2217Fri7-Oct08:0018:0010:00172:0040:000:000:003300 HEMS Early
2318Sat8-Oct18:0003:009:00172:0049:000:000:002211 HEMS Late
2419Sun9-Oct18:0003:009:00172:0048:000:000:002222 HEMS Late
2520Mon10-Oct18:0003:009:00181:0057:000:000:002233 HEMS Late
2621Tue11-Oct181:0057:000:000:003333 OFF
2722Wed12-Oct181:0047:000:000:004433 OFF
2823Thu13-Oct181:0037:000:000:005533 OFF
2924Fri14-Oct171:0027:000:000:006633 OFF
3025Sat15-Oct08:0018:0010:00171:0028:000:000:006622 HEMS Early
3126Sun16-Oct08:0018:0010:00171:0029:000:000:006611 HEMS Early
3227Mon17-Oct08:0018:0010:00172:0030:000:000:005500 HEMS Early
3328Tue18-Oct18:0003:009:00172:0039:000:000:004411 HEMS Late
34Totals this period:Leave:0Sick:0Off:9
Matt Wilcock
Cell Formulas
RangeFormula
B6:B33B6=VLOOKUP(WEEKDAY(C6),$AE$6:$AF$12,2)
C6C6=AF16-(AF18*28)
C7:C33C7=C6+1
L6L6=SUM(K$6:K6,AI6:AI$33)
M6:M11M6=SUM(K$6:K6,AI28:AI$33)
L7:L14,L16:L20,L22:L32L7=SUM(K$6:K7,AI8:AI$33)
M12:M14,M16:M20,M22:M33,H12,H14:H33M12=SUM(K6:K12)
L15L15=SUM(K$6:K16,AI16:AI$33)
M15M15=SUM(K9:K16)
L21L21=SUM(K$6:K20,AI22:AI$33)
M21M21=SUM(K16:K20)
L33,G33L33=SUM(K6:K33)
O6:O18O6=SUM(AK$6:AK6,AO21:AO$33)
P6:Q11P6=SUM(AL$6:AL6,AP28:AP$33)
R6:R33R6=IFERROR(IF(D6="","",IF(COUNTIF(D2:D5,0.75)=3,IF(SUM(C6:D6,-INDEX(C2:E5,MATCH(1E+100,D2:D5),{1,3}))<--"34:00:00","NO","YES"),"")),"")
P12:Q33P12=SUM(AL6:AL12)
O19:O33O19=SUM(AK6:AK19)
G6G6=SUM(F$6:F6,AH6:AH$33)
G7:G32G7=SUM(F$6:F7,AH8:AH$33)
H6:H11H6=SUM(F$6:F6,AH28:AH$33)
H13H13=SUM(F$6:F13,AH$33:AH35)
H34H34=SUM(Z6:Z33)
K34K34=SUM(AA6:AA33)
N6:N18N6=SUM(AC$6:AC6,AJ21:AJ$33)
N19:N33N19=SUM(AC6:AC19)
N34N34=SUM(AB6:AB33)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
Q6:Q33Cell Value>3textNO
P6:P33Cell Value>4textNO
H6:H33Cell Value>2.5textYES
G6:G33Cell Value>8.33333333333333textYES
H6:H33Cell Value>2.5textYES
L6:L33Cell Value>90textYES
M6:M33Cell Value>30textYES
G6:G33Cell Value>200textYES
H6:H33Cell Value>60textYES
 
Upvote 0
If you look at row 17 it's indicating "yes" where it should show "no" as the start time is well before the 34 hours allowed.
We are comparing row 17 to row 15 yes?

That is a difference of 53 hours!!!

edit:- ignore me, I just realised that the finish time is the following day. :oops: I'll do a quick edit to the formula and post it shortly.

If the finish time for an 18:00 start will always be after midnight then the easiest way to fix it with your sheet layout would be to change "34:00:00" to "58:00:00", i.e. adding another 24 hours to it.
 
Last edited:
Upvote 0
We are comparing row 17 to row 15 yes?

That is a difference of 53 hours!!!

edit:- ignore me, I just realised that the finish time is the following day. :oops: I'll do a quick edit to the formula and post it shortly.

If the finish time for an 18:00 start will always be after midnight then the easiest way to fix it with your sheet layout would be to change "34:00:00" to "58:00:00", i.e. adding another 24 hours to it.
Hi Jason, Yes that works. Many thanks for your patience with me on this task much appreciated.
 
Upvote 0

Forum statistics

Threads
1,214,395
Messages
6,119,265
Members
448,881
Latest member
Faxgirl

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