Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default TIME(13,0,0) v. --"13:00"?

Generally, I believe it is better to use DATE(2009,1,2) instead
of --"1/2/2009" because the interpretation of the latter depends Regional
and Language settings.

What about TIME(13,0,0) v. --"13:00"?

In my (US) Regional and Language settings, ":" is the only separator in the
drop-down list.

But I presume it is a drop-down list for a reason. Do some languages use a
differ time separator, at least optionally?

Do some languages specify time in a different order than hh:mm?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default TIME(13,0,0) v. --"13:00"?

I don't know about other locale's time separator (I've never seen
anything but ":", but that doesn't mean anything conclusive.), but
TIME will roll over at 24 hours. E.g.,

=TIME(36,0,0)

will return 12:00:00 or in serial format 0.5. The (36-24) hours are
lost. But --"36:00:00" will correctly return 36:00:00 or in serial
format 1.5. The difference can be very important.

I generally don't use the TIME function in worksheet functions.
Instead, I use a VBA function:

Function TimeX(H As Long, M As Long, S As Long) As Date
TimeX = TimeSerial(H, M, S)
End Function


This will properly handle hours 24. For example,

=TimeX(36,0,0)

`will correctly return 36:00:00 or 1.5 in serial format. If H is
negative, the numeric result is correct (=TimeX(-6,0,0) - -0.25) but
unless you have the 1904 date setting enabled, Excel won't display the
negative time. Instead, it will display #####.

If you don't want to use VBA and have the Hour component of a time in
a cell, say G1, you can use

=TIME(G1,0,0)+INT(G1/24)

to return the correct time, not rounded at 24 hours. It does not,
however, handle negative hours.


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Thu, 27 Aug 2009 15:22:30 -0700, "JoeU2004"
wrote:

Generally, I believe it is better to use DATE(2009,1,2) instead
of --"1/2/2009" because the interpretation of the latter depends Regional
and Language settings.

What about TIME(13,0,0) v. --"13:00"?

In my (US) Regional and Language settings, ":" is the only separator in the
drop-down list.

But I presume it is a drop-down list for a reason. Do some languages use a
differ time separator, at least optionally?

Do some languages specify time in a different order than hh:mm?

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
cannot use "Create List" and "Share Workbook" same time Devendra Excel Discussion (Misc queries) 0 October 26th 06 06:05 AM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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