?
Solved

Business Days andHolidays Function

Posted on 2014-11-01
5
Medium Priority
?
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

752 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