ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   formula for if result is friday, make it thursday. (https://www.excelbanter.com/excel-worksheet-functions/175807-formula-if-result-friday-make-thursday.html)

joe schmo

formula for if result is friday, make it thursday.
 
I have the following formula:
=WORKDAY(DATE(YEAR(G1),MONTH(A46)+1,0)-(MAX(0,WEEKDAY(DATE(YEAR(G1),MONTH(A46)+1,0),2)-5)),-7)

basically it gives me the 8th last working day of the month. Now if the
result of that is a Friday, I want it to diplay Thursday's date. or if the
result is Monday, I want it to display Tuesday's date.

Does this make sense? any help greatly appreciated.
thanks
joe

Ron Rosenfeld

formula for if result is friday, make it thursday.
 
On Wed, 6 Feb 2008 10:28:05 -0800, joe schmo
wrote:

I have the following formula:
=WORKDAY(DATE(YEAR(G1),MONTH(A46)+1,0)-(MAX(0,WEEKDAY(DATE(YEAR(G1),MONTH(A46)+1,0),2)-5)),-7)

basically it gives me the 8th last working day of the month. Now if the
result of that is a Friday, I want it to diplay Thursday's date. or if the
result is Monday, I want it to display Tuesday's date.

Does this make sense? any help greatly appreciated.
thanks
joe



How about:

=WORKDAY(DATE(YEAR(G1), MONTH(A46)+1,0),-8)-
(WEEKDAY(WORKDAY(DATE(YEAR(G1), MONTH(A46)+1,0),-8))=6)+
(WEEKDAY(WORKDAY(DATE(YEAR(G1), MONTH(A46)+1,0),-8))=2)

IF I am off by one day in interpreting your "8th last working day", merely
adjust the -8 factor accordingly.
--ron


All times are GMT +1. The time now is 04:29 PM.

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