Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bluenose
 
Posts: n/a
Default Multiple date calculations

Hello.
I have a function that allows me to calculate the length of time between two
dates.

=YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
<=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<M ONTH(A1),DAY(B1)
=DAY(A1)),12,IF(AND(MONTH(B1)MONTH(A1),DAY(B1)<D AY(A1)),-1)))&" months, "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"


I have a list of dates in adjacent columns. I want to be able to display the
result of this function in a third column, for the two dates in each row.
Can anyone tell me whether or not it is possible to somehow do this more
easily than pasting the function into each cell of the 3rd column and
changing the cell references in the funtion manually?
This is not practical as the columns are too large!
I only have a limited knowledge of Excel so I apologise if this is a simple
query.
Hope you clever people can help!
Many thanks

  #2   Report Post  
Pat Flynn
 
Posts: n/a
Default

Put your formula in your 3rd column top row C2.do EditCopy on the cell with
your formula. Select (highlight) from C2: wherever. While range is
highlighted, go to Editpaste. The references will all be changed relative
to the row address. Double check this works before you start producing
data/reports based on this data..
Pat

"Bluenose" wrote:

Hello.
I have a function that allows me to calculate the length of time between two
dates.

=YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
<=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<M ONTH(A1),DAY(B1)
=DAY(A1)),12,IF(AND(MONTH(B1)MONTH(A1),DAY(B1)<D AY(A1)),-1)))&" months, "&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"


I have a list of dates in adjacent columns. I want to be able to display the
result of this function in a third column, for the two dates in each row.
Can anyone tell me whether or not it is possible to somehow do this more
easily than pasting the function into each cell of the 3rd column and
changing the cell references in the funtion manually?
This is not practical as the columns are too large!
I only have a limited knowledge of Excel so I apologise if this is a simple
query.
Hope you clever people can help!
Many thanks

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

If you go to the bottom right of the cell until the cursor changes to a
thick black cross, you can then click and drag the formula down. It will
adjust for each row.

BTW, you can use a simpler formula

=DATEDIF(A1,B1,"y") & " years, " & DATEDIF(A1,B1,"ym") & " months, " &
DATEDIF(A1,B1,"md") & " days"

but you need the Analysis Toolpak installed.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bluenose" wrote in message
...
Hello.
I have a function that allows me to calculate the length of time between

two
dates.

=YEAR(B1)-YEAR(A1)-IF(OR(MONTH(B1)<MONTH(A1),AND(MONTH(B1)=MONTH(A1),
DAY(B1)<DAY(A1))),1,0)&" years, "&MONTH(B1)-MONTH(A1)+IF(AND(MONTH(B1)
<=MONTH(A1),DAY(B1)<DAY(A1)),11,IF(AND(MONTH(B1)<M ONTH(A1),DAY(B1)
=DAY(A1)),12,IF(AND(MONTH(B1)MONTH(A1),DAY(B1)<D AY(A1)),-1)))&" months,

"&B1-DATE(YEAR(B1),MONTH(B1)-IF(DAY(B1)<DAY(A1),1,0),DAY(A1))&" days"

I have a list of dates in adjacent columns. I want to be able to display

the
result of this function in a third column, for the two dates in each row.
Can anyone tell me whether or not it is possible to somehow do this more
easily than pasting the function into each cell of the 3rd column and
changing the cell references in the funtion manually?
This is not practical as the columns are too large!
I only have a limited knowledge of Excel so I apologise if this is a

simple
query.
Hope you clever people can help!
Many thanks



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 Calculations Bruce Excel Worksheet Functions 11 May 19th 05 01:09 AM
date and bond calculations saturnin02 Excel Discussion (Misc queries) 4 April 29th 05 07:57 PM
date and bond calculations saturnin02 Excel Worksheet Functions 1 April 29th 05 05:34 PM
Latest date from multiple list Lomax Excel Worksheet Functions 1 April 14th 05 11:58 PM
Best technique to perform multiple calculations ? [email protected] Excel Worksheet Functions 5 January 25th 05 03:49 AM


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