ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need help with a date function formula (https://www.excelbanter.com/excel-discussion-misc-queries/42823-need-help-date-function-formula.html)

KAA

Need help with a date function formula
 

I have an excel sheet header which includes a date, the date is to
represent yesterday's date ( =Today()-1 ), which then would come into
the spread sheet as August 8th, 2005, assuming today was August 9th.
The problem is on days like Monday when the previous day was sunday,
how can I make the formula output the Friday before the Monday instead
of Sunday ...example on Monday, August 11th, the formula would read
August 10th, I need it to read August 8th...? Please help, thanks


--
KAA
------------------------------------------------------------------------
KAA's Profile: http://www.excelforum.com/member.php...o&userid=26755
View this thread: http://www.excelforum.com/showthread...hreadid=400071


Domenic

Try...

=WORKDAY(TODAY(),-1)

....which requires that the Analysis ToolPak be enabled...

Tools Add-Ins and check Analysis ToolPak

Hope this helps!

In article ,
KAA wrote:

I have an excel sheet header which includes a date, the date is to
represent yesterday's date ( =Today()-1 ), which then would come into
the spread sheet as August 8th, 2005, assuming today was August 9th.
The problem is on days like Monday when the previous day was sunday,
how can I make the formula output the Friday before the Monday instead
of Sunday ...example on Monday, August 11th, the formula would read
August 10th, I need it to read August 8th...? Please help, thanks


David Hepner

Try this:

=IF(WEEKDAY(NOW()-1)=1,(NOW()-3),NOW()-1)

"KAA" wrote:


I have an excel sheet header which includes a date, the date is to
represent yesterday's date ( =Today()-1 ), which then would come into
the spread sheet as August 8th, 2005, assuming today was August 9th.
The problem is on days like Monday when the previous day was sunday,
how can I make the formula output the Friday before the Monday instead
of Sunday ...example on Monday, August 11th, the formula would read
August 10th, I need it to read August 8th...? Please help, thanks


--
KAA
------------------------------------------------------------------------
KAA's Profile: http://www.excelforum.com/member.php...o&userid=26755
View this thread: http://www.excelforum.com/showthread...hreadid=400071




All times are GMT +1. The time now is 08:46 PM.

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