Solved

Business Days andHolidays Function

Posted on 2014-11-01
5
113 Views
Last Modified: 2014-11-03
hello,

I have rows of data and have a formula as below but mos tof the formulas do not have the part about WORKDAY and HOLIDAYS as shown below.  It will take me a long time to manually change the formulas to add the WORKDAY and HOLIDAY (named ranged of HOliday_US_Jap)

I imagine there is a function I can use to apply to a certain column (ie column H has all the dates).  Basically, if the column of dates contains either  date on the weekend or is a date that is a HOLIDAY then move forward to the next available day that is a weekday and is not a holiday.  Hope that makes sense.  I cant simply use a find and replace as the formulas are vastly different.  I was only adding the WORKDAY and HOLIDAY parts.
thak you

here is the formula.  I have modified with the bold
=WORKDAY(EDATE(H34,CHOOSE(MATCH(D35,{"annually","quarterly","semi-annually","monthly"},0),12,3,6,1))-1,10,Holidays_US_Jap)
0
Comment
Question by:pdvsa
  • 3
  • 2
5 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40417557
I presume what you are asking is, how to add an extra column with this outer bit of the formula.

Sounds like the answer should be

=Workday(h2,10,Holidays_US_Jap)

Where h2 is your current formula.

Or am I missing something?
0
 

Author Comment

by:pdvsa
ID: 40417614
Philip, actually that is jot what I am after.  The formula is different for many rows.  I might be able to get it to work but what I am really after is code that will update the column for weekday and holiday.  

Let me know what you think.  

Thank you
0
 

Author Comment

by:pdvsa
ID: 40418402
Philip, is it clear what I am trying to do?  Basically, instead of putting the WEEDAY and HOLIDAY function within the cell, I would like to be able to apply it by code such as within a function (hit Alt F11 and the code shows)

thank you
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40418979
Do you mean this (make sure your spreadsheet is saved before running this code):

Sub ExpandFormula()
For introw = 1 To 10000
    If Cells(introw, 8).Formula <> "" Then
        Cells(introw, 8).Formula = "=Workday(" & Mid(Cells(introw, 8).Formula, 2, 9999) & ",Holidays_US_Jap)"
    End If
Next
End Sub

Open in new window

0
 

Author Comment

by:pdvsa
ID: 40419658
Phillip, thank you.  I think I will have to do it manually though because I have some formulas that already have the WORDAYS function.  No problem, I can do manually.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

943 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now