Display yesterday's date but only for weekdays?

T

totalnatal

Hi,

I have the following function : =TODAY()-1

The problem is that if we're monday it gives me sunday's date whereas
I only want weekdays so in this case friday.

Any idea on how to mod the function to do that?

thanks
 
M

Mike H

Hi,

Try this.

=WORKDAY(NOW(),-1)

If you get a #MAME error then

Tools|Addins and check the analysis toolpak.

Mike
 
S

Shane Devenshire

Sorry if this posts twice but had a crash when I clicked Post

This depends on what days you do this for, if you only use the file Monday
to Friday then

=TODAY()-(MOD(TODAY(),7)=2)-1

If on the otherhand you might open the file on Sunday then the above will
need to be modified.
 
T

totalnatal

Sorry if this posts twice but had a crash when I clicked Post

This depends on what days you do this for, if you only use the file Monday
to Friday then

=TODAY()-(MOD(TODAY(),7)=2)-1

If on the otherhand you might open the file on Sunday then the above will
need to be modified.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire









- Show quoted text -

Hey,

Thanks, I think it works but was wondering how you constructed it,
especially regarding the use of MOD function. Thanks
 
R

Ron Rosenfeld

THIS WORKS :) !

You could also use =workday(today(),-1)
If you are using a version of Excel prior to 2007, and receive the #NAME! error, look at HELP for the WORKDAY function for instructions on installing the Microsoft Analysis ToolPak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top