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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 :) ! |
Display yesterday's date but only for weekdays?
|
All times are GMT +1. The time now is 01:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com