ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Set a date as a constant to work back from to show only weekdays (https://www.excelbanter.com/excel-discussion-misc-queries/63891-set-date-constant-work-back-show-only-weekdays.html)

Happy Gilmore

Set a date as a constant to work back from to show only weekdays
 
I would like to input one date as a constant and then apply a formaula in
other cells relating to this date to calculate back from but to "round" back
to only weekdays. For example if i type in a date of February 1st 2006 (a
Wednesday) and would like to calculate backwards automatically by eleven days
it is Sat Jan 21st 2006. I would like this to round back to the nearest
previous workday which would be the Friday.

Ron Rosenfeld

Set a date as a constant to work back from to show only weekdays
 
On Sun, 8 Jan 2006 19:11:02 -0800, "Happy Gilmore" <Happy
wrote:

I would like to input one date as a constant and then apply a formaula in
other cells relating to this date to calculate back from but to "round" back
to only weekdays. For example if i type in a date of February 1st 2006 (a
Wednesday) and would like to calculate backwards automatically by eleven days
it is Sat Jan 21st 2006. I would like this to round back to the nearest
previous workday which would be the Friday.


The Workday function can do what you want. There is also an optional Holidays
argument to adjust for that, if you choose to use it. See HELP.

=workday(StartDate-NumDays+1,-1)

If the WORKDAY function is not available, and returns the #NAME? error, install
and load the Analysis ToolPak add-in.

On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.

--ron


All times are GMT +1. The time now is 06:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com