Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nambo27
 
Posts: n/a
Default The left function does not work when displaying times, how is thi.

The left function does not work when displaying times on Excel 2000. I
entered the data in the following format "9:40," but the data box converts it
to "9:40.00 AM." I changed the format so the time appears as "9:40" on the
spreadsheet. However, I want to display just the hour, the first digit, in
the next column. When I use the left function (=LEFT(B4, 1)), I always get a
zero. Just to see what happened, I displayed the left 4 digits and I receive
some unusual fractions "0.402..." I would greatly appreciate some help on
this topic. Thanks!
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=INT(A1*24)

should do it

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nambo27" wrote in message
...
The left function does not work when displaying times on Excel 2000. I
entered the data in the following format "9:40," but the data box converts

it
to "9:40.00 AM." I changed the format so the time appears as "9:40" on

the
spreadsheet. However, I want to display just the hour, the first digit,

in
the next column. When I use the left function (=LEFT(B4, 1)), I always

get a
zero. Just to see what happened, I displayed the left 4 digits and I

receive
some unusual fractions "0.402..." I would greatly appreciate some help on
this topic. Thanks!



  #3   Report Post  
Tim C
 
Posts: n/a
Default

Other options:

=HOUR(B4)

=B4
and use the custom format h

Tim C

"Nambo27" wrote in message
...
The left function does not work when displaying times on Excel 2000. I
entered the data in the following format "9:40," but the data box converts
it
to "9:40.00 AM." I changed the format so the time appears as "9:40" on
the
spreadsheet. However, I want to display just the hour, the first digit,
in
the next column. When I use the left function (=LEFT(B4, 1)), I always
get a
zero. Just to see what happened, I displayed the left 4 digits and I
receive
some unusual fractions "0.402..." I would greatly appreciate some help on
this topic. Thanks!



  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

=HOUR(B4)

Or
=B4
and format as custom "h"

In excel, date and time are just numbers. Dates are integer numbers, the
count of days starting from 1 January 1900. Time is decimal part of this
number, i.e. 1 matches for 24 hours. So the time interval 1 hour is really a
number, equal to 1/24.
Because date and time are both numbers, you can easily use datetime values
in Excel (formatted p.e. as "dd.mm.yyyy hh:mm" or "yyyy/mm/dd hh:mm:ss"
etc.), and adding/substaracting time and date values is a simple arithmetic.
When you operate only with time values, you can ignore date (integer) part
(so long the time intervals remain <24 hours), but really you are using
times from 31. December 1899 (the date 0.1.1900).


Arvi Laanemets


"Nambo27" wrote in message
...
The left function does not work when displaying times on Excel 2000. I
entered the data in the following format "9:40," but the data box converts

it
to "9:40.00 AM." I changed the format so the time appears as "9:40" on

the
spreadsheet. However, I want to display just the hour, the first digit,

in
the next column. When I use the left function (=LEFT(B4, 1)), I always

get a
zero. Just to see what happened, I displayed the left 4 digits and I

receive
some unusual fractions "0.402..." I would greatly appreciate some help on
this topic. 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
How to nest a left function within a sumif function? LisaK Excel Worksheet Functions 2 April 23rd 23 11:46 AM
How do I protect work sheet against the "Delete" function? Kev Nurse Excel Discussion (Misc queries) 1 February 17th 05 03:01 AM
Concatenate Function will not work Chuck W Excel Discussion (Misc queries) 4 January 31st 05 11:41 PM
Displaying value of specific cell within a range, with IF function...? Steve Excel Discussion (Misc queries) 1 January 14th 05 02:23 AM
left worksheet function within a combo box Billing Goddess Excel Worksheet Functions 3 November 15th 04 08:58 PM


All times are GMT +1. The time now is 06:28 PM.

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

About Us

"It's about Microsoft Excel"