Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default 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
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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 :) !
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Would like to add 20 working/weekdays to a date Pete Excel Discussion (Misc queries) 8 October 25th 05 05:09 PM
Date, Weekdays Heckstein Excel Discussion (Misc queries) 3 September 11th 05 10:21 PM
Subtracting weekdays from a date: Richard Excel Worksheet Functions 4 May 11th 05 02:44 AM
count weekdays in a date range benb Excel Worksheet Functions 1 January 13th 05 02:49 PM
Date exclude weekdays LukePW New Users to Excel 9 December 20th 04 05:00 PM


All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"