Delivery Dates with weekends and public holidays

charlie25

New Member
Joined
Sep 10, 2007
Messages
7
Hi All,

I'm trying to build a tool to lookup delivery times in Excel 2007 and I'm a bit stuck. The requirements i have are;

- Each suburb can have a different delivery timeframe, these are located on a separate sheet
- Delivery times are in working days so it needs to account for weekends and public holidays (public holidays vary by state and are also on a separate sheet)
- Don't want to use VBA because macros are disabled by default

What i have so far is;
Excel Workbook
EFGHJ
5Delivery PostcodeSuburbStateExpected Business Days for DeliveryEarliest possible delivery date
62000DAWES POINTNSW117/02/2011
7HAYMARKETNSW321/02/2011
Three
Excel 2007
Cell Formulas
RangeFormula
F6=VLOOKUP($E$6,'Raw Data'!$A$1:$QA$5000,$D6,FALSE)
F7=VLOOKUP($E$6,'Raw Data'!$A$1:$QA$5000,$D7,FALSE)
G6=VLOOKUP($E$6,'Raw Data'!$A$1:$QA$5000,($D6+1),FALSE)
G7=VLOOKUP($E$6,'Raw Data'!$A$1:$QA$5000,($D7+1),FALSE)
H6=VLOOKUP($E$6,'Raw Data'!$A$1:$QA$5000,($D6+2),FALSE)
J6=WORKDAY(TODAY(),H6,(VLOOKUP(G6,'Public Holidays'!A:C,3,FALSE)))
J7=WORKDAY(TODAY(),H7,(VLOOKUP(G7,'Public Holidays'!A:C,3,FALSE)))


The problem is with the formula in J6 and J7, it's meant to look for any holidays in NSW from the public holidays sheet and add a day for each one to the delivery time. 2 problems;

1. Because i've used vlookup it will only pick up the first row of public holidays, any suggestions how i can make it look for all holiday dates in NSW (or another state the delivery is going to). I can rearrange the holiday dates pretty much however i need to.

2. If there's a public holiday today, it doesnt add an extra day to the delivery period. It works fine if the PH is any day after today.

I'm still learning with Excel so if anyone can suggest solutions to these probs and/or how to simplify what i have that would be awesome.

Cheers,

Charlie
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Have the public holidays in named ranges and use the INDIRECT function to choose which holiday range it should use in the calculations. Also, you're going to need to add the Public Holidays -names to a column in your lookup list (or have them in a separate lookup table) so that the lookup function returns the name of the Public Holiday range for each postcode. So the basic formulas would be something like:

=WORKDAY(TODAY(),H7,INDIRECT( any function that returns the name of the range you need to use for the postcode ))

If your named range for NSW holidays would be NSW then you could simply use:

=WORKDAY(TODAY(),H7,INDIRECT(G7))
 
Last edited:
Upvote 0
Thanks Misca,

I'm using INDIRECT now and it works great to fix problem 1, but I'm still having problem 2.

If it's 16/2 and i enter 16/2 as a public holday in my NSW holidays range it doesn't add a day to the delivery time. If I add a holiday on 17/2 or later it works fine.

Anyone have any ideas how to fix this? I guess the problem is the workday function is counting forward from 16/2 so isn't taking a holiday on 16/2 into account? I tried the below so it would start counting from 15/2 but there's a formula error in the today function.

=WORKDAY(TODAY(-1),H6,INDIRECT(G6))+1

Cheers,

Charlie
 
Upvote 0
Seems to work for me:
Excel Workbook
FGHI
5Pick Up DateStateDuration (days)Delivery date
615.2.11NSW117.2.11
715.2.11QLD116.2.11
815.2.11SA321.2.11
9
10Public Holidays
11NSWQLDSA
1216.2.1118.2.1116.2.11
1318.2.11
Sheet

I used 3 named ranges in my example ("NSW"=G12, "QLD"=H12,"SA"=I12:I13). Just make sure your Holiday Dates are real dates.

Also, if you add +1 to the date the workday function returns, you're going to get Saturday if the function returns Friday. Might be better is you added the +1 to the Days Required -part of the formula:

=WORKDAY(TODAY(-1),H6+1,INDIRECT(G6))
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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