ETA Round Date Excluding Weekends

RD1982

New Member
Joined
Nov 10, 2022
Messages
39
Office Version
  1. 365
Platform
  1. Windows
Hi Gurus,

Could you please help to build a workday and/or other formula for the below table?

Formula Location: Correct STO ETA column which I calculate the ASN Creation Date + PDT by rounding up if falls on weekends
ETA Difference status = if Correct STO ETA column is equal to ASN Delivery Date Column

Problem: The column called "Correct STO ETA" will need to round date ONLY if falls on Saturday, Sunday and or Public Holidays. First line is an example of what should be showing but I get only 20/05 which is Saturday.

Thanks in advance!


ASN Creation DateASN Delivery DatePDTCorrect STO ETAETA Difference
19/05/202322/05/2023122/05/20230
19/05/202322/05/2023120/05/2023-2
19/05/202322/05/2023120/05/2023-2
19/05/202322/05/2023120/05/2023-2
19/05/202322/05/2023120/05/2023-2
19/05/202322/05/2023120/05/2023-2
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try in D2:
=WORKDAY(A2,C2)

if you have somewhere to store holidays. i.w, X1:X10:
=WORKDAY(A2,C2,$X$1:$X$10)
 
Upvote 0
Thank you @bebo021999 ... The above formula I tried for the orders with short lead time (i.e.: 1, 2, 3 days) but if I apply for orders like sea freight (36 days) which we count all days (including wkd) and/or rail which is 14 days also including weekends then I'd have the incorrect dates for these lanes....do you see a way I could differentiate them?
 
Upvote 0
Not really surprising it didn't work for Sea freight or Rail, as you never mentioned anything about that.

Can you post some sample data that shows all the relevant data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Try this

=WORKDAY(ASN Creation Date + PDT-1,1,Holidays)

.
 
Upvote 0
amazing let me try this tool. Thanks! Will come back to you soon
 
Upvote 0
Dear

bebo021999, Phuoc and Fluff,​


I was thinking a better way to exemplify my query after your advise, I found the below.

I'm using the formula: =IF(ISBLANK(T3),"Not PGI Yet",IF(E3=T3,"Expedited",IF(NETWORKDAYS(E3,T3)<=2,"On Time","Late"))) - The problem is when I have PGI Date as 0/01/1900 and STO Delivery Date is past due...I am not capturing as late...to check. Could you please help me?

I attached excel file with some examples and my notes on column U to facilitate your side. Much appreciate.

STOLine ItemCreated onSupp PlantRec PlantSTO Delivery DateSTO QtyUOMTrip IDJob IdOBDASNROUTEPGI DatePlanned GR DateGR DateStatus of STO Line?Late PGId?Late GR?OverdueNotes
74034801571023/06/2023102710267/07/2023200.000CARA1109902740348015700873802330183735083AU0996
26/06/2023​
7/07/2023​
0/01/1900OPENOn TimeLateNo Action RequiredOrder created on 23/06 so PGI = next work day whch in this case is on time and GR should be on time because is not due date yet (07/07/2023)
74034809271026/06/20231026103111/07/202318.000KEGA111090574034809270087384705AU0994
0/01/1900​
11/07/2023​
0/01/1900​
OPENDelayedOn TimeNo Action RequiredPGI didn't happen on 27/07 as expected so it's late
74034819392026/06/20231027103029/06/2023260.000CARA1109408740348193900873883100183745139AU0260
28/06/2023​
29/06/2023​
29/06/2023​
COMPLETELateLateNo Action RequiredThis should NOT be GR late because was received on 29/06 as expected due date
74034802981023/06/20231030102727/06/2023271.000CAR00873953540183740692AU0330
27/06/2023​
27/06/2023​
28/06/2023​
COMPLETELateLateOverduePGI should be on 26/06 and GR should be on 27/06 because we have 1 day lead time and therefore this is classified as overdue order

1688018820727.png
 
Upvote 0
Another quick one is how do I calculate the number of days late if my PGI date has the 0/01/1900 date?

For example below table I should have the number if "Days PGI Late" as showing below but if I calculate how many days we are late betwwen "Expected PGI Date and PGI Date" all I get is -45103....-388895

Expected PGI DatePGI DateDays PGI LateIf calculate the difference appear the below
26/06/20230/01/19003-45103
27/06/20060/01/19002-38895
28/06/20230/01/19001-45105
28/06/20230/01/19001-45105
 
Upvote 0
How about
Fluff.xlsm
ABCD
1Expected PGI DatePGI DateDays PGI LateIf calculate the difference appear the below
226/06/202300/01/190033
327/06/202300/01/190022
428/06/202300/01/190011
528/06/202300/01/190011
Sheet4
Cell Formulas
RangeFormula
D2:D5D2=NETWORKDAYS(A2,IF(B2=0,TODAY(),B2))-1
 
Upvote 0
Hi @Fluff many thanks did work for calculation of PGI Days. Thank you very much! May I ask you (sorry i don't get) the meaning of repeating B2 and -1? so just I understand the concept of the calculation...I got it until the "today()". Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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