# End of Month, use preceding workday

Experts, I need the end of the month but use preceding workday if lands on a holiday.  I think the formula is similar to the below but I get an error.

=WORKDAY(EOMONTH(H124,1),1)),1),Holidays_US_Jap)

thank you
Project financeAsked:
###### Who is Participating?

Commented:
There is a useful reference to the WORKDAY function at http://www.excelfunctions.net/Excel-Workday-Function.html

Your formula should look like:
=WORKDAY(EOMONTH(H124,1)+1,-1)

This takes the first day of the next month then returns the previous work day which will be the last work day of the month you want.

You could add a parameter as follows:
=WORKDAY(EOMONTH(H124,1)+1,-1,Z1:Z9)
where Z1:Z9 contains dates you want to include as holidays.
0

Commented:
What is
Holidays_US_Jap

a named range ?

the formula should rather be:
=WORKDAY(EOMONTH(H124,1),1,Holidays_US_Jap)

gowflow
0

Excel VBA DeveloperCommented:
I'm restating to be sure I understand exactly what you need.

Given a date value (in this case, in cell H124), you want to return the last business day of the following month, excluding holidays (listed in the range Holidays_US_Jap).  Correct?

If so, this formula will do that:
=WORKDAY(EOMONTH(H124,1),-1,Holidays_US_Jap)

For example, make January 30 a holiday (temporarily) in your Holidays_US_Jap table.  Then make H124 any date in December, 2014.  Since January 31 falls on a Saturday, January 30 would normally be returned.  But if you make January 30, 2015 a holiday, January 29 is returned instead.

Regards,
-Glenn
0

Project financeAuthor Commented:
Perfect, thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Already a member? Login.

All Courses

From novice to tech pro — start learning today.