#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Date calculation

I would like to calculate how many months it has been from one cell to
another. Example: cell a1 has 1/5/2009 and cell b1 has 5/17/2009. Is
there a function for this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Date calculation

tonyalt3 wrote:
I would like to calculate how many months it has been from one cell to
another. Example: cell a1 has 1/5/2009 and cell b1 has 5/17/2009. Is
there a function for this?



http://www.cpearson.com/excel/datedif.aspx
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Date calculation

"tonyalt3" wrote:
I would like to calculate how many months it has been
from one cell to another. Example: cell a1 has 1/5/2009
and cell b1 has 5/17/2009.


The correct solution for you depends on how you want to count the month
difference.

One solution:

=datedif(A1,A2,"m")

where A1 has 1/5/2009 and A2 has 5/17/2009.

But note that A1 were 1/18/2009, DATEDIF would result in 3. If you would
prefer 4 still, another solution is:

=(year(A2)-year(A1))*12 + month(A2)-month(A1)

On the other hand, note that the latter solution would return 1 if A1 were
1/31/2009 and A2 is 2/1/2009; that is, "one month" for a single day's
difference. Is that acceptable?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Date calculation

Yes. The one Excel function which isn't mentioned in Excel help, DATEDIF:
http://www.cpearson.com/excel/datedif.aspx
--
David Biddulph

"tonyalt3" wrote in message
...
I would like to calculate how many months it has been from one cell to
another. Example: cell a1 has 1/5/2009 and cell b1 has 5/17/2009. Is
there a function for this?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Date calculation

On Jun 8, 9:49*am, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
Yes. *The one Excel function which isn't mentioned in Excel help, DATEDIF:http://www.cpearson.com/excel/datedif.aspx
--
David Biddulph

"tonyalt3" wrote in message

...



I would like to calculate how many months it has been from one cell to
another. *Example: cell a1 has 1/5/2009 and cell b1 has 5/17/2009. *Is
there a function for this?- Hide quoted text -


- Show quoted text -


This is perfect! Thanks


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Date calculation

Hi,

The undocumented DATEDIF function has the following form:

DATEDIF(StartDate,EndDate,Unit)

Where Units are on the left in the table below and their results on the
right. Note that the Unit must be quoted - "y" for example.

y Whole years between two dates
m Whole months between two dates
d Whole days between two dates
md Number of days between two dates ignoring months
ym Number of months between two dates ignoring years
yd Number of days between two dates ignoring years

=DATEDIF(A1,A2,"Y") returns the number of whole years between the dates in
cell A1 and A2
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"tonyalt3" wrote:

I would like to calculate how many months it has been from one cell to
another. Example: cell a1 has 1/5/2009 and cell b1 has 5/17/2009. Is
there a function for this?

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 (from entered date / 1yr later in next field) ajaminb Excel Worksheet Functions 6 September 29th 08 02:11 PM
Calculation between 2 date? Cam Excel Discussion (Misc queries) 3 April 17th 08 09:16 PM
End Date Calculation (adding a start date duration) Silena K-K Excel Discussion (Misc queries) 5 January 25th 08 04:27 PM
Date calculation Funkyfido Excel Worksheet Functions 3 March 22nd 07 10:04 AM
Tricky Date calculation: How to calculate a future date [email protected] Excel Discussion (Misc queries) 9 August 11th 06 04:24 AM


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