Date, Weekdays

H

Heckstein

Hi!

Could you please help me with date formula.

I need to enter 2 days before but it must be a weekday.
e.g 12 Sep 2005 must show 9 Sep 2005 and also 13 Sep 2005 must show 9
Sep 2005.

What I have is NOW()-2 , but it shows 10 Sep 2005 which is wrong.
 
P

PeterAtherton

Heckstein said:
Hi!

Could you please help me with date formula.

I need to enter 2 days before but it must be a weekday.
e.g 12 Sep 2005 must show 9 Sep 2005 and also 13 Sep 2005 must show 9
Sep 2005.

What I have is NOW()-2 , but it shows 10 Sep 2005 which is wrong.
Hi

Try
=IF(WEEKDAY(TODAY())=6,TODAY()-1,IF(WEEKDAY(TODAY())=1,TODAY()-2,TODAY()-2))

Regards
Peter
 
R

Ron Rosenfeld

Hi!

Could you please help me with date formula.

I need to enter 2 days before but it must be a weekday.
e.g 12 Sep 2005 must show 9 Sep 2005 and also 13 Sep 2005 must show 9
Sep 2005.

What I have is NOW()-2 , but it shows 10 Sep 2005 which is wrong.

=WORKDAY(TODAY()-1,-1)

Note that with this function, you can optionally add a list of Holidays.


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
 
Top