Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Display yesterday's date but only for weekdays?

1,722 views
Skip to first unread message

totalnatal

unread,
Jul 21, 2009, 8:09:03 AM7/21/09
to
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

Mike H

unread,
Jul 21, 2009, 8:24:01 AM7/21/09
to
Hi,

Try this.

=WORKDAY(NOW(),-1)

If you get a #MAME error then

Tools|Addins and check the analysis toolpak.

Mike

Gary''s Student

unread,
Jul 21, 2009, 8:38:02 AM7/21/09
to
=TODAY()-CHOOSE(WEEKDAY(TODAY()),2,3,1,1,1,1,1,1)
--
Gary''s Student - gsnu200859

Shane Devenshire

unread,
Jul 21, 2009, 10:26:01 AM7/21/09
to
I hope you don't get a "MAME" error!

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

Cheers,
Shane Devenshire

Mike H

unread,
Jul 21, 2009, 10:37:01 AM7/21/09
to
OOPS tpyos R'US

Mkie

Shane Devenshire

unread,
Jul 21, 2009, 10:38:02 AM7/21/09
to
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

totalnatal

unread,
Jul 22, 2009, 3:17:14 AM7/22/09
to
On Jul 21, 3:38 pm, Shane Devenshire
> > thanks- Hide quoted text -
>
> - Show quoted text -

Hey,

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

rach...@gmail.com

unread,
Nov 15, 2012, 8:50:26 AM11/15/12
to
THIS WORKS :) !

Ron Rosenfeld

unread,
Nov 15, 2012, 11:43:44 AM11/15/12
to
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
0 new messages