This should work
=DATE(YEAR(NOW()),MONTH(NOW()),15)-MAX(0,WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW(
)),15),2)-5)
I couldn't get it to work. I substituted a cell reference for NOW() in both of
our formulas.
Using your formula:
=DATE(YEAR(A7),MONTH(A7),15)-MAX(0,WEEKDAY(DATE(YEAR(A7),MONTH(NOW()),15),2)-5)
vs mine:
=workday(DATE(YEAR(A7),MONTH(A7),15-(MONTH(A7)=2)),(WEEKDAY(DATE(YEAR(A7),MONTH(A7),
15-(MONTH(A7)=2)))=1)-(WEEKDAY(DATE(YEAR(A7),MONTH(A7),15-(MONTH(A7)=2)))=7),holidays)
I get these (selected) different results:
Peo Ron
Tuesday, January 14, 2003 Wednesday, January 15, 2003
Monday, April 14, 2003 Tuesday, April 15, 2003
Wednesday, May 14, 2003 Thursday, May 15, 2003
Saturday, June 14, 2003 Monday, June 16, 2003
Monday, July 14, 2003 Tuesday, July 15, 2003
Thursday, August 14, 2003 Friday, August 15, 2003
Sunday, September 14, 2003 Monday, September 15, 2003
Tuesday, October 14, 2003 Wednesday, October 15, 2003
Sunday, December 14, 2003 Monday, December 15, 2003
Sunday, February 15, 2004 Friday, February 13, 2004
Saturday, May 15, 2004 Friday, May 14, 2004
Sunday, August 15, 2004 Monday, August 16, 2004
Saturday, January 15, 2005 Friday, January 14, 2005
Tuesday, February 15, 2005 Monday, February 14, 2005
Sunday, May 15, 2005 Monday, May 16, 2005
I did choose to use the 15th for mid-month for all months except February,
where I chose to use the 14th. But using your formula on my system, for some
months it gives the 14th and other months the 15th, even when both are
weekdays. I also get some weekend days in there.
--ron