Re: How to calculate date and time
- From: "kasey" <kasey@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 5 Jul 2005 08:35:09 -0700
I am calculating the difference between two dates and times. For example,
6/3/2004 14:50 - 6/1/2004 12:00. The formula I am using now is
=text(a1-a2,"m, d, hh:mm"). When this formula calcuates the month
(especially in the example I just gave), the value for month is shown as one
more than what the answer should be. This is what is produces: 6/3/2004
14:50 - 6/1/2004 12:00 = 1, 2, 14:50. It should equal 0, 2, 14:50. The time
is important especially when calculation over a 24 hr period.
Any other ideas?
"Ron Rosenfeld" wrote:
> On Fri, 1 Jul 2005 13:36:16 -0700, "kasey" <kasey@xxxxxxxxxxxxxxxxxxxxxxxxx>
> wrote:
>
> >please help me in something
> >i have two cells:
> >31/10/2004 18:00
> >01/09/2004 07:00
> >i want to subtract the two cells
> >the result i am taking is 29/02/1900 11:00
> >but the correct result is 29 and one month
> >what can i do
> >thanks
>
> This is a common problem given that months (and years) have a variable number
> of days. So you have to decide how you want to represent certain values.
>
> For example, given dates:
>
> 31 Jan 2005
> 1 Mar 2005
>
> The Datedif function previously recommended will give an answer of
> 1 month -2 days
>
> I would think 1 month 1 day makes more sense.
>
> But, what about
>
> 28 Jan 2005
> 1 Mar 2005
>
> Do you want an answer of
> 1 month 1 day
> or
> 1 month 4 days
>
> The latter would be correct if you were counting full calendar months (February
> in this case) plus the days that were outside of full calendar months (28-31
> Jan + 1 March). But could give answers, under certain circumstances, of more
> than 31 days.
>
>
> --ron
>
.
- Follow-Ups:
- Re: How to calculate date and time
- From: Ron Rosenfeld
- Re: How to calculate date and time
- From: Ron Rosenfeld
- Re: How to calculate date and time
- From: Nikki94
- Re: How to calculate date and time
- References:
- How to calculate date and time
- From: kasey
- Re: How to calculate date and time
- From: Ron Rosenfeld
- How to calculate date and time
- Prev by Date: Setting Precision when using &"Characters"& in a cell reference
- Next by Date: Keeping track of loan payments and interest
- Previous by thread: Re: How to calculate date and time
- Next by thread: Re: How to calculate date and time
- Index(es):
Relevant Pages
|
Loading