PC Review


Reply
Thread Tools Rate Thread

date subtraction difficulty

 
 
Peter
Guest
Posts: n/a
 
      18th Jul 2006
I'm trying to subtract dates, to calculate time duration. I'm
subtracting column A from column B into column C. Column C is
formatted 'm "mos", dd "days"' and columns A and B are formatted
'mm/dd/yy/@' Unfortunately each of the durations is 1 month too
long. That is, if the real duration is 4 days, column C will
display '1 mos, 4 days'

Any clue what I'm doing here?

Thanks much.
 
Reply With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      18th Jul 2006
On Tue, 18 Jul 2006 11:58:10 -0500, Peter <(E-Mail Removed)>
wrote:

>I'm trying to subtract dates, to calculate time duration. I'm
>subtracting column A from column B into column C. Column C is
>formatted 'm "mos", dd "days"' and columns A and B are formatted
>'mm/dd/yy/@' Unfortunately each of the durations is 1 month too
>long. That is, if the real duration is 4 days, column C will
>display '1 mos, 4 days'
>
>Any clue what I'm doing here?
>
>Thanks much.


If you are formatting the target cell as a date, Excel will display it as a
date!

So if B1-A1 = 4, Excel interprets that as a date, doing just what you told it
to do.

Day 4 in Excel is 4 January 1900

Since the "m" in your format code means to display the numeric equivalent of
the month of the year, and since the month of the year is January, Excel will
display a "1" for your "m" token.

The difference between two dates is NOT a date; rather it is a number.

So for the number of Days, you could format as 0" days"

For days and months, you will need to decide what you mean by "month" since a
month can be 28, 29, 30 or 31 days long.


--ron
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date subtraction -How to not show negative when 2nd date not entered Edward Microsoft Excel New Users 1 27th Sep 2007 03:03 PM
RE: Date subtraction -How to not show negative when 2nd date not enter =?Utf-8?B?UHJhbmF2IFZhaWR5YQ==?= Microsoft Excel New Users 0 27th Sep 2007 02:06 PM
Please help with Date Subtraction =?Utf-8?B?QWRyaWFuYQ==?= Microsoft Access 13 28th Jun 2006 01:57 AM
Subtraction date to date and answer in Months =?Utf-8?B?d2FoZWVkIFNoYWh6YWQ=?= Microsoft Access Queries 1 14th Jun 2006 09:11 AM
Date Subtraction =?Utf-8?B?Sm9obiBDYWxkZXI=?= Microsoft Excel Discussion 3 10th Nov 2005 02:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:44 AM.