Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Result in days and/or months

I would like to calculate two dates and get the result in days and/or
months. Can someone advise the syntax to get it.

Thanks,

Scott

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default Result in days and/or months

On Nov 14, 3:02 pm, "Scott" wrote:
I would like to calculate two dates and get the result in days and/or
months. Can someone advise the syntax to get it.

Thanks,

Scott


Hi Scott

Let's say A1 is your first date '1.Nov 2007
A2 is your second date '14.Nov 2007

you want to have the number of days in B1:
=A2-A1
Format the cell as general, it returns 13

you want to have the number of months in B2:
=month(A2-A1) + (year(A2-A1)-1900)*12

you want to have the numbers of days, without months
=day(A2-A1)

hth

Carlo

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Result in days and/or months

For number of months you may find =DATEDIF(A1,A2,"m") easier than Carlo's
formula.
--
David Biddulph

"carlo" wrote in message
ups.com...
On Nov 14, 3:02 pm, "Scott" wrote:
I would like to calculate two dates and get the result in days and/or
months. Can someone advise the syntax to get it.

Thanks,

Scott


Hi Scott

Let's say A1 is your first date '1.Nov 2007
A2 is your second date '14.Nov 2007

you want to have the number of days in B1:
=A2-A1
Format the cell as general, it returns 13

you want to have the number of months in B2:
=month(A2-A1) + (year(A2-A1)-1900)*12

you want to have the numbers of days, without months
=day(A2-A1)

hth

Carlo



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default Result in days and/or months

On Nov 14, 3:02 pm, "Scott" wrote:
I would like to calculate two dates and get the result in days and/or
months. Can someone advise the syntax to get it.

Thanks,

Scott


Let's say A1 is your first date '1.Nov 2007
A2 is your second date '14.Nov 2007

you want to have the number of days in B1:
=A2-A1
Format the cell as general, it returns 13

you want to have the number of months in B2:
=month(A2-A1) + (year(A2-A1)-1900)*12

you want to have the numbers of days, without months
=day(A2-A1)

hth

Carlo

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
how do i convert a number of days to years, months & days? SafetyLen Excel Discussion (Misc queries) 1 August 23rd 07 01:34 AM
i have two days and i want the difference in days, months, year maja Excel Worksheet Functions 7 April 22nd 06 01:14 AM
Add # of months and get result last day of # months. BDP Excel Discussion (Misc queries) 2 January 25th 06 03:51 AM
convert Days to Years, Months, Days Klaudebou Excel Discussion (Misc queries) 3 December 29th 05 10:33 PM
not all months have 31 days jsc3489 Charts and Charting in Excel 4 November 22nd 05 03:19 PM


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