View Single Post
  #5  
Old April 20th, 2010, 03:07 AM posted to microsoft.public.excel.newusers
T. Valko
external usenet poster
 
Posts: 15,759
Default Time Formatting Question

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"John Calder" wrote in message
...
Thanks ! This was an excellent answer to my question. Well Done !

"T. Valko" wrote:

When you formatted the times as "m" Excel evaluates just "m" as the
MONTH.
That's why you got a displayed value of 1. Excel evaluated 1:53:00 AM as
January 1, 1900 1:53:00 AM. So, m = 1 (for January).

When you include the brackets [m] Excel then evaluates the "m" as minutes
and the brackets keep the minutes from rolling over into hours at 60
minutes.

The same thing happens and is easier to see what Excel is doing when
dealing
with times that span more than 24 hours.

Enter 25:00 in a cell and make sure the format is h:mm. You'll see that
Excel displays 1:00. The hours rolled over into days at 24 hours so Excel
displays the remainder which is 1 hour (25 hours minus 24 hours).

Now, change the format to [h]:mm and you'll now see that Excel displays
25:00.

So, the brackets [ ] keep the unit of measure from rolling over to the
next
higher unit of measure.

--
Biff
Microsoft Excel MVP


"John Calder" wrote in message
...
Hi

I run Excel 2K

I download various times from a mainframe. When the come down they look
like
this:

1:53:00 AM

When I try a custom format to convert this to minutes I get the number
1
as
a result.

I use fortmat:cell:custom:m

But, if I enclose the "m" in square brackets ( [m] ) then it converts
the
time to minutes which is what I want. I would like to know what the [ ]
brackets do?

Thanks



.