Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default How to subtract two date Problem

Hi
I have a sheet to calculate the number of months between to date.
in A1 = 05/26/2007
B1 =06/26/2006
C1 = =DATEVALUE (B1-A1)
After that C1 shows me €śvalue€ť which is an error
Can any body help me solving this problem?
Thanks!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default How to subtract two date Problem

DATEVALUE() converts a text representation of a date into a real date.

To get the number of days between the two dates simply subtract them:

=B1-A1

To get the number of years use DATEDIF() as in:

=DATEDIF(A1,B1,"y")

or for the number of months left over use:

=DATEDIF(A1,B1,"ym")

and for thr odd days use:

=DATEDIF(A1,B1,"md")

to combine them all together:

=DATEDIF(A1,B1,"y") & " Years "&DATEDIF(A1,B1,"ym")&" Months
"&DATEDIF(A1,B1,"md")&" Days"


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"ghost" wrote in message
...
Hi
I have a sheet to calculate the number of months between to date.
in A1 = 05/26/2007
B1 =06/26/2006
C1 = =DATEVALUE (B1-A1)
After that C1 shows me "value" which is an error
Can any body help me solving this problem?
Thanks!!




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How to subtract two date Problem

Try,

=MONTH(B1)-MONTH(A1)

Format as general.

Mike
"ghost" wrote:

Hi
I have a sheet to calculate the number of months between to date.
in A1 = 05/26/2007
B1 =06/26/2006
C1 = =DATEVALUE (B1-A1)
After that C1 shows me €śvalue€ť which is an error
Can any body help me solving this problem?
Thanks!!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default How to subtract two date Problem

http://www.cpearson.com/excel/datedif.htm

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"ghost" wrote in message ...
| Hi
| I have a sheet to calculate the number of months between to date.
| in A1 = 05/26/2007
| B1 =06/26/2006
| C1 = =DATEVALUE (B1-A1)
| After that C1 shows me "value" which is an error
| Can any body help me solving this problem?
| Thanks!!
|




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default How to subtract two date Problem

Because the dates are in different years your formula returns 1 for dates 13
months apart.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike H" wrote in message
...
Try,

=MONTH(B1)-MONTH(A1)

Format as general.

Mike
"ghost" wrote:

Hi
I have a sheet to calculate the number of months between to date.
in A1 = 05/26/2007
B1 =06/26/2006
C1 = =DATEVALUE (B1-A1)
After that C1 shows me "value" which is an error
Can any body help me solving this problem?
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
add/subtract dates problem in Excel..... Gary in Pennsyl Excel Discussion (Misc queries) 3 May 31st 06 08:58 PM
Formula to subtract a date from current date Fidelio1st Excel Worksheet Functions 3 February 27th 06 03:36 AM
Text to date then subtract... ryan Excel Discussion (Misc queries) 5 December 7th 05 06:09 PM
How do I subtract a date from a date for a sum of total years? Paige Excel Discussion (Misc queries) 4 October 27th 05 03:10 PM
how can i subtract time from two different date? Manoo Excel Worksheet Functions 1 March 8th 05 04:00 AM


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