dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,375
- Office Version
- 365
- 2016
- Platform
- Windows
I have a table that is used for a sheet for generating quotes and every line of the quote table has a cell or column where the date is entered (This cell is A17 or column A). Then there is a cell next to it that calculates if the date is a weekday, weekend or public holiday (This cell is B17). It has the formula =IF(A17="","",IF(COUNTIF(Sheet2!G38:G48,A17),"Public Holiday",IF(WEEKDAY(A17,2)>5,"Weekend","Mon-Fri"))).
The holidays are calculated as follows. In sheet2!G39:G49, there is a list of the public holidays for the current year. Here is a list of formulas in those cells.
G36: =NOW()
G37: =YEAR(G36)
G38: =DATE(G37,1,1)
G39: =DATE(G37,1,26)
G40: =FLOOR(DAY(MINUTE(G37/38)/2+56)&"/05/"&G37,7)-34
G41:=G40-1
G42: =G40-2
G43: =G40+1
G44: =DATE(G37,4,25)
G45: =DATE(G37,6,1+7*2)-WEEKDAY(DATE(G37,6,8-2))
G46: =DATE(G37,10,1+7*1)-WEEKDAY(DATE(G37,10,8-2))
G47; =DATE(G37,12,25)
G48: =DATE(G37,12,26)
This works perfectly for calculating the date to be a public holiday in the current year but my boss wants to be able to complete a quote with dates of activities relating to the quote in a subsequent year. If I use the current cells for calculating the date, it won't work.
I need to be able to enter a line in the quote that has a date in the current year but on the next line, enter a date for the following year or any subsequent year and have it work out if the date is a public holiday, weekday or weekend.
Thanks,
Dave
The holidays are calculated as follows. In sheet2!G39:G49, there is a list of the public holidays for the current year. Here is a list of formulas in those cells.
G36: =NOW()
G37: =YEAR(G36)
G38: =DATE(G37,1,1)
G39: =DATE(G37,1,26)
G40: =FLOOR(DAY(MINUTE(G37/38)/2+56)&"/05/"&G37,7)-34
G41:=G40-1
G42: =G40-2
G43: =G40+1
G44: =DATE(G37,4,25)
G45: =DATE(G37,6,1+7*2)-WEEKDAY(DATE(G37,6,8-2))
G46: =DATE(G37,10,1+7*1)-WEEKDAY(DATE(G37,10,8-2))
G47; =DATE(G37,12,25)
G48: =DATE(G37,12,26)
This works perfectly for calculating the date to be a public holiday in the current year but my boss wants to be able to complete a quote with dates of activities relating to the quote in a subsequent year. If I use the current cells for calculating the date, it won't work.
I need to be able to enter a line in the quote that has a date in the current year but on the next line, enter a date for the following year or any subsequent year and have it work out if the date is a public holiday, weekday or weekend.
Thanks,
Dave