ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Limit TODAY() to weekdays only (https://www.excelbanter.com/excel-discussion-misc-queries/115695-limit-today-weekdays-only.html)

CharlieS

Limit TODAY() to weekdays only
 
I need to make TODAY() only inlcude weekdays never weekends. I need to set
up a formula that will show yesterday's date, but I don't want it to ever
give me the weekend. I am only interested in weekdays... Any suggestions?
+TODAY()-1 gives me yesterady but will return the weekend, I don't want to
have to say =TODAY()-3, because it's only minus 3 on Friday...

Elkar

Limit TODAY() to weekdays only
 
Try this:

=IF(WEEKDAY(TODAY())=2,TODAY()-3,TODAY()-1)

This checks to see if today is Monday, if so, then subtract 3 days, if not,
subtract 1 day.

HTH,
Elkar


"CharlieS" wrote:

I need to make TODAY() only inlcude weekdays never weekends. I need to set
up a formula that will show yesterday's date, but I don't want it to ever
give me the weekend. I am only interested in weekdays... Any suggestions?
+TODAY()-1 gives me yesterady but will return the weekend, I don't want to
have to say =TODAY()-3, because it's only minus 3 on Friday...


Sandy

Limit TODAY() to weekdays only
 
Use networkdays ie:

=NETWORKDAYS(TODAY(),TODAY()-1) gives the number of work week days
including today if today (monday) it will return 2


Sandy


CharlieS wrote:
I need to make TODAY() only inlcude weekdays never weekends. I need to set
up a formula that will show yesterday's date, but I don't want it to ever
give me the weekend. I am only interested in weekdays... Any suggestions?
+TODAY()-1 gives me yesterady but will return the weekend, I don't want to
have to say =TODAY()-3, because it's only minus 3 on Friday...



Ron Coderre

Limit TODAY() to weekdays only
 
Try something like this:

=TODAY()-1-MAX(WEEKDAY(TODAY()-1,2)-5,0)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"CharlieS" wrote:

I need to make TODAY() only inlcude weekdays never weekends. I need to set
up a formula that will show yesterday's date, but I don't want it to ever
give me the weekend. I am only interested in weekdays... Any suggestions?
+TODAY()-1 gives me yesterady but will return the weekend, I don't want to
have to say =TODAY()-3, because it's only minus 3 on Friday...


Bob Phillips

Limit TODAY() to weekdays only
 
=WORKDAY(TODAY(),-1)

WORKDAY is part of the Analysis Toolpak, so it must be installed
(ToolsAddins)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"CharlieS" wrote in message
...
I need to make TODAY() only inlcude weekdays never weekends. I need to

set
up a formula that will show yesterday's date, but I don't want it to ever
give me the weekend. I am only interested in weekdays... Any

suggestions?
+TODAY()-1 gives me yesterady but will return the weekend, I don't want to
have to say =TODAY()-3, because it's only minus 3 on Friday...





All times are GMT +1. The time now is 02:17 PM.

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