Excel formula help needed On time Delivery

Zilla

Board Regular
Joined
Nov 16, 2006
Messages
88
Office Version
  1. 2016
Platform
  1. Windows
I need help with the following spreadsheet.

It is to report On Time Delivery. I have set up as much as I can but to be honest I need help on the formula in column " G ".
The report is based on deliverys on the same day mostly within a 12 hour period.

This is what I am hoping to achieve/

1) If the time in column D is prior to the ETA but not prior to the ship time show in cell G2 as " On Time "

2) If the time in column D is prior to the ETA and prior to the ship time show in cell G2 as " Early "

3) If the time in column D is after the ETA show in cell G2 as " Late "

4) Regardless of what time is entered in column D, if a letter ( A, B, C etc. ) shows in column F show in cell G2 as " On Time "

The letters are used when a delivery will technically be late due but due to a reason such as customer NSF.


Any help would be appreciated.




Excel Workbook
ABCDEFG
1WEEKLY SCHEDULESHIP TIMEETAACTUALDiffCommentOn Time / Late
2Store 112:002:00 PM1:25 PM-0:35On Time
3Store 212:003:00 PM2:25 PM-0:35On Time
4Store 312:004:00 PM11:25 AM-4:35AOn Time
5Store 412:005:00 PM5:20 PM0:20Late
6Store 512:006:00 PM6:20 PM0:20BOn Time
7Store 612:007:00 PM7:20 PM0:20BOn Time
8Store 712:008:00 PM11:00 AM-9:00Early
9Store 812:009:00 PM11:00 AM-10:00COn Time
10Store 912:0010:00 PM10:30 AM-11:30Early
11Store 108:00 AM7:00 AM-1:00On Time
12Store 119:00 AM8:00 AM-1:00On Time
13Store 1210:00 AM9:00 AM-1:00On Time
14Store 1311:00 AM10:00 AM-1:00On Time
15Store 1412:00 PM12:00 PM0:00On Time
16Store 151:00 PM2:00 PM1:00Late
17Store 162:00 PM3:00 PM1:00Late
18Store 173:00 PM4:00 PM1:00Late
19Store 184:00 PM5:00 PM1:00Late
20Store 195:00 PM11:00 AM-6:00On Time
21Store 206:00 PM12:00 PM-6:00On Time
22Store 217:00 PM1:00 PM-6:00On Time
23Store 228:00 PM2:00 PM-6:00On Time
Weekly
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Excel 2010<table rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB" cellpadding="2.5px"><colgroup><col style="background-color: #DAE7F5" width="25px"><col><col><col><col><col><col><col></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr><td style="color: #161120;text-align: center;">1</td><td style=";">WEEKLY SCHEDULE</td><td style=";">SHIP TIME</td><td style=";">ETA</td><td style=";">ACTUAL</td><td style=";">Diff</td><td style=";">Comment</td><td style="text-align: right;;"></td></tr><tr><td style="color: #161120;text-align: center;">2</td><td style=";">Store 1</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">2:00 PM</td><td style="text-align: right;;">1:25 PM</td><td style=";">-0:35</td><td style="text-align: right;;"></td><td style=";">On time</td></tr><tr><td style="color: #161120;text-align: center;">3</td><td style=";">Store 2</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">3:00 PM</td><td style="text-align: right;;">2:25 PM</td><td style=";">-0:35</td><td style="text-align: right;;"></td><td style=";">On time</td></tr><tr><td style="color: #161120;text-align: center;">4</td><td style=";">Store 3</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">4:00 PM</td><td style="text-align: right;;">11:25 AM</td><td style="text-align: right;;">0</td><td style=";">A</td><td style=";">On time</td></tr><tr><td style="color: #161120;text-align: center;">5</td><td style=";">Store 4</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">5:00 PM</td><td style="text-align: right;;">5:20 PM</td><td style="text-align: right;;">0:20</td><td style="text-align: right;;"></td><td style=";">Late</td></tr><tr><td style="color: #161120;text-align: center;">6</td><td style=";">Store 5</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">6:00 PM</td><td style="text-align: right;;">6:20 PM</td><td style="text-align: right;;">0:20</td><td style=";">B</td><td style=";">On time</td></tr><tr><td style="color: #161120;text-align: center;">7</td><td style=";">Store 6</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">7:00 PM</td><td style="text-align: right;;">7:20 PM</td><td style="text-align: right;;">0:20</td><td style=";">B</td><td style=";">On time</td></tr><tr><td style="color: #161120;text-align: center;">8</td><td style=";">Store 7</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">8:00 PM</td><td style="text-align: right;;">11:00 AM</td><td style=";">-9:00</td><td style="text-align: right;;"></td><td style=";">Early</td></tr><tr><td style="color: #161120;text-align: center;">9</td><td style=";">Store 8</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">9:00 PM</td><td style="text-align: right;;">11:00 AM</td><td style=";">-10:00</td><td style=";">C</td><td style=";">On time</td></tr><tr><td style="color: #161120;text-align: center;">10</td><td style=";">Store 9</td><td style="text-align: right;;">12:00</td><td style="text-align: right;;">10:00 PM</td><td style="text-align: right;;">10:30 AM</td><td style="text-align: right;;">0</td><td style="text-align: right;;"></td><td style=";">Early</td></tr><tr><td style="color: #161120;text-align: center;">11</td><td style=";">Store 10</td><td style="text-align: right;;"></td><td style="text-align: right;;">8:00 AM</td><td style="text-align: right;;">7:00 AM</td><td style=";">-1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">12</td><td style=";">Store 11</td><td style="text-align: right;;"></td><td style="text-align: right;;">9:00 AM</td><td style="text-align: right;;">8:00 AM</td><td style=";">-1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">13</td><td style=";">Store 12</td><td style="text-align: right;;"></td><td style="text-align: right;;">10:00 AM</td><td style="text-align: right;;">9:00 AM</td><td style=";">-1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">14</td><td style=";">Store 13</td><td style="text-align: right;;"></td><td style="text-align: right;;">11:00 AM</td><td style="text-align: right;;">10:00 AM</td><td style=";">-1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">15</td><td style=";">Store 14</td><td style="text-align: right;;"></td><td style="text-align: right;;">12:00 PM</td><td style="text-align: right;;">12:00 PM</td><td style="text-align: right;;">0:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">16</td><td style=";">Store 15</td><td style="text-align: right;;"></td><td style="text-align: right;;">1:00 PM</td><td style="text-align: right;;">2:00 PM</td><td style="text-align: right;;">1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">17</td><td style=";">Store 16</td><td style="text-align: right;;"></td><td style="text-align: right;;">2:00 PM</td><td style="text-align: right;;">3:00 PM</td><td style="text-align: right;;">1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">18</td><td style=";">Store 17</td><td style="text-align: right;;"></td><td style="text-align: right;;">3:00 PM</td><td style="text-align: right;;">4:00 PM</td><td style="text-align: right;;">1:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">19</td><td style=";">Store 18</td><td style="text-align: right;;"></td><td style="text-align: right;;">4:00 PM</td><td style="text-align: right;;">5:00 PM</td><td style="text-align: right;;">1:00</td><td style=";"> </td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">20</td><td style=";">Store 19</td><td style="text-align: right;;"></td><td style="text-align: right;;">5:00 PM</td><td style="text-align: right;;">11:00 AM</td><td style=";">-6:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">21</td><td style=";">Store 20</td><td style="text-align: right;;"></td><td style="text-align: right;;">6:00 PM</td><td style="text-align: right;;">12:00 PM</td><td style=";">-6:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">22</td><td style=";">Store 21</td><td style="text-align: right;;"></td><td style="text-align: right;;">7:00 PM</td><td style="text-align: right;;">1:00 PM</td><td style=";">-6:00</td><td style="text-align: right;;"></td><td style=";"></td></tr><tr><td style="color: #161120;text-align: center;">23</td><td style=";">Store 22</td><td style="text-align: right;;"></td><td style="text-align: right;;">8:00 PM</td><td style="text-align: right;;">2:00 PM</td><td style=";">-6:00</td><td style="text-align: right;;"></td><td style=";"></td></tr></tbody></table>
Sheet5


<table rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" width="85%" cellpadding="2.5px"><tbody><tr><td style="padding:6px">Worksheet Formulas<table rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB" width="100%" cellpadding="2.5px"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th style=" background-color: #DAE7F5;color: #161120" width="10px">E4</th><td style="text-align:left">=-3:34</td></tr><tr><th style=" background-color: #DAE7F5;color: #161120" width="10px">E10</th><td style="text-align:left">=-10:29</td></tr><tr><th style=" background-color: #DAE7F5;color: #161120" width="10px">G2</th><td style="text-align:left">=IF(B2="","",IF(F2<>"","On time",IF(AND(D2>B2,D2<=C2),"On time",IF(AND(D2<C2,D2<B2),"Early",IF(D2>C2,"Late")))))</td></tr></tbody></table></td></tr></tbody></table>
There is no data in B11 down so this formula return empty cell.
Copy furmula down
 
Upvote 0
Try this

Code:
=IF(ISBLANK(F4) = FALSE, "On Time", IF(AND(D4<C4,D4>B4), "On Time", IF(AND(D4<C4, D4<B4),"Early", IF(D4>C4, "Late"))))
 
Last edited:
Upvote 0
=IF(ISBLANK(F4) = FALSE, "On Time", IF(AND(D4<C4,D4>B4), "On Time", IF(AND(D4<C4, D4<B4),"Early", IF(D4>C4, "Late"))))<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
 
Upvote 0
Hi All
First thanks for the replys. I tried Robert Mika's formula and it worked except for G5 shows as Early where in truth it is 20 minutes late. It seems to show all lates as earlys.

I also tried guerillaunit's formula and it gave me an error. I pasted the formula into cell G4 since it references B4 C4 and D4. And still an error pops up.

Any help on how I can correct the two issues?

Thanks
 
Upvote 0
Hi Zilla,
Sometimes the formating does not come uo correctly try this:=IF(B2="","",IF(F2<>"","On time",IF(AND(D2>B2,D2<=C2),"On time",IF(AND(D2 < B2),"Early",IF(D2>C2,"Late")))))

The missing bit is in red just delete the sapce after D2
 
Upvote 0
Hi Zilla,
Check your private messages. The thread kept deleting a part of the code I was posting. I think Robert might have had the same problem
 
Upvote 0
One last question.
If there is no time entered in the "actual time " field EARLY appears.
Is there a way of adding to the formula so that if the "actual time " field is blank then nothing appears in the " On time / Late " column.

Thanks
 
Upvote 0
=IF(D2="","",IF(B2="","",IF(F2<>"","On time",IF(AND(D2>B2,D2<=C2),"On time",IF(AND(D2 < B2),"Early",IF(D2>C2,"Late"))))))
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,129
Members
449,097
Latest member
mlckr

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