Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 151
Default Date Calculation question

I was able to successfully use someone's help on this site to calculate the
following

Add 60 Calendar dates, excluding holidays with the holidays defined in a
hidden column. using the following formula:
A2-A1-COUNTIF(C1:C7,""&A)+COUNTIF(C1:C7,""&A2)...

While this excludes returning a Holiday date, it doesn't add days in lieu of
the Holiday for the returned date..example If I want to count 45 Calendar
days from 11/20/09, I do not want it to land on Thanksgiving or Christmas, I
want it two additional days if that occurs? How can I incomporate this in
the above formula?

Thanks,
Amanda
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Date Calculation question

Why don't you just use Workday

=WORKDAY(A1,A2,C1:C7)

--
__________________________________
HTH

Bob

"Amanda" wrote in message
...
I was able to successfully use someone's help on this site to calculate the
following

Add 60 Calendar dates, excluding holidays with the holidays defined in a
hidden column. using the following formula:
A2-A1-COUNTIF(C1:C7,""&A)+COUNTIF(C1:C7,""&A2)...

While this excludes returning a Holiday date, it doesn't add days in lieu
of
the Holiday for the returned date..example If I want to count 45 Calendar
days from 11/20/09, I do not want it to land on Thanksgiving or Christmas,
I
want it two additional days if that occurs? How can I incomporate this in
the above formula?

Thanks,
Amanda



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Date Calculation question

OP is not excluding weekends, only holidays.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Bob Phillips" wrote:

Why don't you just use Workday

=WORKDAY(A1,A2,C1:C7)

--
__________________________________
HTH

Bob

"Amanda" wrote in message
...
I was able to successfully use someone's help on this site to calculate the
following

Add 60 Calendar dates, excluding holidays with the holidays defined in a
hidden column. using the following formula:
A2-A1-COUNTIF(C1:C7,""&A)+COUNTIF(C1:C7,""&A2)...

While this excludes returning a Holiday date, it doesn't add days in lieu
of
the Holiday for the returned date..example If I want to count 45 Calendar
days from 11/20/09, I do not want it to land on Thanksgiving or Christmas,
I
want it two additional days if that occurs? How can I incomporate this in
the above formula?

Thanks,
Amanda




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Date Calculation question

Might be easier to do with a UDF (user-defined-function). Open up the VBE by
pressing Alt+F11. Then goto Insert - Module. Paste this in:

'========
Function ExcludeDays(Start_Date As Date, Days As Integer, _
Holidays As Range) As Date

If Days < 0 Then
ExcludeDays = "#VALUE!"
Exit Function
End If

Do While Days 0
Start_Date = Start_Date + 1
For Each cell In Holidays
If Start_Date = cell.Value Then
'If a holiday, don't count
x = 0
Exit For
Else
'If not a holiday, count it
x = 1
End If
Next

Days = Days - x
Loop

ExcludeDays = Start_Date

End Function
'==============

Back in your worbook, your formula becomes:
=ExcludeDays(A1,60,C1:C7)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Amanda" wrote:

I was able to successfully use someone's help on this site to calculate the
following

Add 60 Calendar dates, excluding holidays with the holidays defined in a
hidden column. using the following formula:
A2-A1-COUNTIF(C1:C7,""&A)+COUNTIF(C1:C7,""&A2)...

While this excludes returning a Holiday date, it doesn't add days in lieu of
the Holiday for the returned date..example If I want to count 45 Calendar
days from 11/20/09, I do not want it to land on Thanksgiving or Christmas, I
want it two additional days if that occurs? How can I incomporate this in
the above formula?

Thanks,
Amanda

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date calculation question JoAnn New Users to Excel 3 February 27th 08 05:52 PM
Date calculation across workbooks / Workbook naming question. Phil Excel Discussion (Misc queries) 2 February 1st 08 12:55 PM
Tricky Date calculation: How to calculate a future date [email protected] Excel Discussion (Misc queries) 9 August 11th 06 04:24 AM
A simple date calculation question. Seldum Excel Discussion (Misc queries) 11 June 29th 06 10:48 AM
A simple date calculation question. Seldum Excel Discussion (Misc queries) 2 June 26th 06 04:56 PM


All times are GMT +1. The time now is 08:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"