#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default formatting cells

In cell C2 I wrote the formula ((C1-365)*24) where C1 is (365.25) thus the
value for cell C2 is 6. what I want to do is format cell C2 so that it will
be shown as 6 with a PM next to it. I want this formula to work for all
values that I put for cell C1. For example, if cell C1 equals 365.3468, the
formula in cell C2 would yeild a value 8.3232 but excel would format this
value for me into a time - 8:19:23.52 PM
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default formatting cells

First don't multiply by 24. I assume 24 is hours per day.

In Excel a Day = 1, and an hour = 1/24.

So 365.25 = 365 = .25 which is a quarter of a day or 6:00 AM.

Now if you have a date/Time combined and want to get hours you need only the
fractional part of the Date/Time

3995.34 (3995 is the date and .34 is the hours)

Use the MOD() function

Mod(3995.34,1) = .34

If you format the .34 as time it will display as hours minutes seconds.

"excelguy" wrote:

In cell C2 I wrote the formula ((C1-365)*24) where C1 is (365.25) thus the
value for cell C2 is 6. what I want to do is format cell C2 so that it will
be shown as 6 with a PM next to it. I want this formula to work for all
values that I put for cell C1. For example, if cell C1 equals 365.3468, the
formula in cell C2 would yeild a value 8.3232 but excel would format this
value for me into a time - 8:19:23.52 PM

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
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Formatting of cells Pete Excel Worksheet Functions 1 February 27th 06 10:17 AM
Formatting Cells longisland Excel Discussion (Misc queries) 3 September 20th 05 10:32 PM
Conditional Formatting Multiple cells based on 2 cells Louis Markowski Excel Worksheet Functions 2 June 1st 05 05:26 PM
Need help formatting cells Vinish Excel Discussion (Misc queries) 6 May 21st 05 02:17 AM


All times are GMT +1. The time now is 02:22 AM.

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"