ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Display yesterday's date but only for weekdays? (https://www.excelbanter.com/excel-worksheet-functions/237536-display-yesterdays-date-but-only-weekdays.html)

totalnatal

Display yesterday's date but only for weekdays?
 
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

Display yesterday's date but only for weekdays?
 
Hi,

Try this.

=WORKDAY(NOW(),-1)

If you get a #MAME error then

Tools|Addins and check the analysis toolpak.

Mike

"totalnatal" wrote:

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


Gary''s Student

Display yesterday's date but only for weekdays?
 
=TODAY()-CHOOSE(WEEKDAY(TODAY()),2,3,1,1,1,1,1,1)
--
Gary''s Student - gsnu200859


"totalnatal" wrote:

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


Shane Devenshire[_2_]

Display yesterday's date but only for weekdays?
 
I hope you don't get a "MAME" error!

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

Cheers,
Shane Devenshire


"Mike H" wrote:

Hi,

Try this.

=WORKDAY(NOW(),-1)

If you get a #MAME error then

Tools|Addins and check the analysis toolpak.

Mike

"totalnatal" wrote:

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

Display yesterday's date but only for weekdays?
 
OOPS tpyos R'US

Mkie

"Shane Devenshire" wrote:

I hope you don't get a "MAME" error!

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

Cheers,
Shane Devenshire


"Mike H" wrote:

Hi,

Try this.

=WORKDAY(NOW(),-1)

If you get a #MAME error then

Tools|Addins and check the analysis toolpak.

Mike

"totalnatal" wrote:

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


Shane Devenshire[_2_]

Display yesterday's date but only for weekdays?
 
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" wrote:

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


totalnatal

Display yesterday's date but only for weekdays?
 
On Jul 21, 3:38*pm, Shane Devenshire
wrote:
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" wrote:
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- 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

[email protected]

Display yesterday's date but only for weekdays?
 
On Tuesday, July 21, 2009 6:08:02 PM UTC+5:30, Gary''s Student wrote:
=TODAY()-CHOOSE(WEEKDAY(TODAY()),2,3,1,1,1,1,1,1)
--
Gary''s Student - gsnu200859


"totalnatal" wrote:

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


THIS WORKS :) !

Ron Rosenfeld[_2_]

Display yesterday's date but only for weekdays?
 
On Thu, 15 Nov 2012 05:50:26 -0800 (PST), wrote:

On Tuesday, July 21, 2009 6:08:02 PM UTC+5:30, Gary''s Student wrote:
=TODAY()-CHOOSE(WEEKDAY(TODAY()),2,3,1,1,1,1,1,1)
--
Gary''s Student - gsnu200859


"totalnatal" wrote:

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


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


All times are GMT +1. The time now is 01:10 PM.

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