Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 176
Default Time Formatting Question

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Time Formatting Question

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



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 176
Default Time Formatting Question

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



.

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
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



.



  #5   Report Post  
Posted to microsoft.public.excel.newusers
No Name
 
Posts: n/a
Default Time Formatting Question



"John Calder" wrote in message
...
Hi

Say your time is in cell A1. In the cell next to it (B1) type the formula
[=a1*24*60]. You must first convert the time[1:53:00] to a decimal number,
Then take that number times 60 to convert it to minutes, which is 113
minutes. Or Take the 1:53:00 times 1440 which is 60 times 24. Make sure
you format cell B1 to Gereran or number.


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




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
Time Formatting Question FinanceStudent Excel Discussion (Misc queries) 2 November 10th 07 03:53 PM
Time Question colin Excel Discussion (Misc queries) 1 March 17th 06 12:37 PM
Best time question Daniel Bonallack Excel Worksheet Functions 2 December 10th 04 11:37 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 4 November 18th 04 03:24 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 0 November 18th 04 03:13 PM


All times are GMT +1. The time now is 09:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"