Solved

End of Month, use preceding workday

Posted on 2015-01-08
4
130 Views
Last Modified: 2015-01-08
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
0
Comment
Question by:pdvsa
4 Comments
 
LVL 13

Accepted Solution

by:
akb earned 500 total points
ID: 40539081
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
 
LVL 29

Expert Comment

by:gowflow
ID: 40539093
What is
Holidays_US_Jap

a named range ?

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

gowflow
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40539097
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
 

Author Closing Comment

by:pdvsa
ID: 40539105
Perfect, thank you
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question