Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Working out a future date with formulas

in cell A2 date, in cell B2 the amount of days i want to add (not including
sundays) i am using this formula

=IF(WEEKDAY(A7)=2,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3))))-1,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3)))))

which works fine but in cells H2:O2 i have dates (Bank Holidays etc) that i
dont want to be included when it works out the dats

E.g

start date 24/08/09 add 10 days finish date at the moment shows 03/09/09
which is correct but there is one bank holiday in there 28/09 so finish date
needs to show as 04/09

is there some thing I can add to the formula above to remove these dates

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Working out a future date with formulas

Hi,

Try this array formula. see below for array formula instructions. You must
create a named range called Holidays that contains your holiday dates

=A2+SIGN(B2)*SMALL(IF((WEEKDAY(A2+SIGN(B2)*(ROW(IN DIRECT("1:"&ABS(B2)*10))))={2,3,4,5,6,7})*
ISNA(MATCH(A2+SIGN(B2)*(ROW(INDIRECT("1:"&ABS(B2)* 10))),Holidays,0)),ROW(INDIRECT("1:"&ABS(B2)*10))) ,ABS(B2))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

As you will see this is a bit long winded so for some time I've been working
on a shorter version that I can't get into a single cell yet!! Here's how far
I've got so far

A1 =start date
A2 = =WORKDAY(A1,7,Holidays)
A3 = =A2-SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=7))


Mike



"cufc1210" wrote:

in cell A2 date, in cell B2 the amount of days i want to add (not including
sundays) i am using this formula

=IF(WEEKDAY(A7)=2,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3))))-1,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3)))))

which works fine but in cells H2:O2 i have dates (Bank Holidays etc) that i
dont want to be included when it works out the dats

E.g

start date 24/08/09 add 10 days finish date at the moment shows 03/09/09
which is correct but there is one bank holiday in there 28/09 so finish date
needs to show as 04/09

is there some thing I can add to the formula above to remove these dates

Cheers

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Working out a future date with formulas

Just to add on to Mikes post..

If WORKDAY() function is not available, and returns the #NAME? error,
install and load the Analysis ToolPak add-in. From menu ToolsAdd-Ins check
'Analysis ToolPak' and hit OK

If this post helps click Yes
---------------
Jacob Skaria


"Mike H" wrote:

Hi,

Try this array formula. see below for array formula instructions. You must
create a named range called Holidays that contains your holiday dates

=A2+SIGN(B2)*SMALL(IF((WEEKDAY(A2+SIGN(B2)*(ROW(IN DIRECT("1:"&ABS(B2)*10))))={2,3,4,5,6,7})*
ISNA(MATCH(A2+SIGN(B2)*(ROW(INDIRECT("1:"&ABS(B2)* 10))),Holidays,0)),ROW(INDIRECT("1:"&ABS(B2)*10))) ,ABS(B2))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

As you will see this is a bit long winded so for some time I've been working
on a shorter version that I can't get into a single cell yet!! Here's how far
I've got so far

A1 =start date
A2 = =WORKDAY(A1,7,Holidays)
A3 = =A2-SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=7))


Mike



"cufc1210" wrote:

in cell A2 date, in cell B2 the amount of days i want to add (not including
sundays) i am using this formula

=IF(WEEKDAY(A7)=2,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3))))-1,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3)))))

which works fine but in cells H2:O2 i have dates (Bank Holidays etc) that i
dont want to be included when it works out the dats

E.g

start date 24/08/09 add 10 days finish date at the moment shows 03/09/09
which is correct but there is one bank holiday in there 28/09 so finish date
needs to show as 04/09

is there some thing I can add to the formula above to remove these dates

Cheers

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Working out a future date with formulas

Thanks Jacob

"cufc1210" wrote:

in cell A2 date, in cell B2 the amount of days i want to add (not including
sundays) i am using this formula

=IF(WEEKDAY(A7)=2,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3))))-1,A7-1-WEEKDAY(A7-1,3)+INT(7/6*(B7+MIN(WEEKDAY(A7-1,3)))))

which works fine but in cells H2:O2 i have dates (Bank Holidays etc) that i
dont want to be included when it works out the dats

E.g

start date 24/08/09 add 10 days finish date at the moment shows 03/09/09
which is correct but there is one bank holiday in there 28/09 so finish date
needs to show as 04/09

is there some thing I can add to the formula above to remove these dates

Cheers

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
save as future date eg expected delivery date ryan Excel Discussion (Misc queries) 0 June 21st 07 03:35 PM
Tricky Date calculation: How to calculate a future date [email protected] Excel Discussion (Misc queries) 9 August 11th 06 04:24 AM
formula to calculate future date from date in cell plus days Chicesq Excel Worksheet Functions 8 November 3rd 05 12:25 PM
date in the future Ron New Users to Excel 1 October 14th 05 05:57 PM
Calculating days between current date and a date in future NETWORKDAYS() function Faheem Khan Excel Worksheet Functions 2 February 10th 05 07:18 PM


All times are GMT +1. The time now is 05:44 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"