Solved

Business Days andHolidays Function

Posted on 2014-11-01
5
116 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

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