View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default calculate weekdays only

On Tue, 21 Sep 2004 13:55:02 -0700, "benb"
wrote:

I am looking for code to insert yesterday's date if yesterday was a weekday,
and to use the previous Friday's date otherwise (if yesterday was Sunday).
Anyone know how to do this? Thanks.



=WORKDAY(A1,-1)

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

How?

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