#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Time format

I tried a variation on this question earlier and recevied some useful
response but now that I understand my question more, maybe I acn narrow it
down.

I would like to store the time "15:00" in the cell but display "3".
Not 3pm or 3:00pm, just "3".

The "h" option in custom format gives me "15".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Time format

You have shown the number 3 in double quotes. Does that mean that you want it
to be text format or is that just the way you have described it?

If you want it as text then the following nested formula will convert the
hours of a time to text. It assumes that the time is in cell A1.

=LEFT(TEXT(A2,"h am/pm"),FIND(CHAR(32),TEXT(A2,"h am/pm"))-1)

However, if you want it to be a numeric value that you can perform
mathematical operations on then use the following:-

=VALUE(LEFT(TEXT(A1,"h am/pm"),FIND(CHAR(32),TEXT(A1,"h am/pm"))-1))

Regards,

OssieMac



"Emerogork via OfficeKB.com" wrote:

I tried a variation on this question earlier and recevied some useful
response but now that I understand my question more, maybe I acn narrow it
down.

I would like to store the time "15:00" in the cell but display "3".
Not 3pm or 3:00pm, just "3".

The "h" option in custom format gives me "15".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default Time format

Format Cells Userdefined Format
in the Type box just type 3


"Emerogork via OfficeKB.com" skrev:

I tried a variation on this question earlier and recevied some useful
response but now that I understand my question more, maybe I acn narrow it
down.

I would like to store the time "15:00" in the cell but display "3".
Not 3pm or 3:00pm, just "3".

The "h" option in custom format gives me "15".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Time format

What do you mean by "Userdefined Format" in that context? I don't have
such an option uinder Format Cells in Excel 2003. If you type 3 into the
Type box in Custom format, it will display 3 for 15:00, but it will also
display 3 for 17:00, which probably isn't what the OP wants.
--
David Biddulph

"excelent" wrote in message
...
Format Cells Userdefined Format
in the Type box just type 3


"Emerogork via OfficeKB.com" skrev:

I tried a variation on this question earlier and recevied some useful
response but now that I understand my question more, maybe I acn narrow
it
down.

I would like to store the time "15:00" in the cell but display "3".
Not 3pm or 3:00pm, just "3".

The "h" option in custom format gives me "15".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Time format

This formula will do the trick

=(A1*24)-(A1--"12:00")*12


"Emerogork via OfficeKB.com" wrote:

I tried a variation on this question earlier and recevied some useful
response but now that I understand my question more, maybe I acn narrow it
down.

I would like to store the time "15:00" in the cell but display "3".
Not 3pm or 3:00pm, just "3".

The "h" option in custom format gives me "15".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Time format

I don't think the OP's question can be solved the way he wants, you gave him
one option by using a second cell that converts the value to an integer and
another would be am event macro that converts the value in the cell to an
integer directly but to keep the actual value of 15:00 in the cell but
displaying it as 3 is not possible


--

Regards,

Peo Sjoblom

"Teethless mama" wrote in message
...
This formula will do the trick

=(A1*24)-(A1--"12:00")*12


"Emerogork via OfficeKB.com" wrote:

I tried a variation on this question earlier and recevied some useful
response but now that I understand my question more, maybe I acn narrow
it
down.

I would like to store the time "15:00" in the cell but display "3".
Not 3pm or 3:00pm, just "3".

The "h" option in custom format gives me "15".

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200708/1




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
Format numbers/time format Pam Excel Discussion (Misc queries) 3 August 1st 07 09:44 PM
Custom Cell format to mimic time format [email protected] Excel Discussion (Misc queries) 6 November 7th 06 09:17 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM
How to format cells in Excel for time in format mm:ss.00 Very Timely Excel Worksheet Functions 0 March 30th 05 07:35 AM
Remove time from a date and time field? Format removes the displa. oaoboc Excel Worksheet Functions 1 February 16th 05 07:20 PM


All times are GMT +1. The time now is 08:54 AM.

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"