Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract hour from date

Hello,

I want to extract the from these cells only the hour:

9/3/2007 2:25:46 AM cell value must become 02
9/3/2007 2:25:46 PM cell value must become 14

I can use date format to show only "hh", but cell value is still
"9/3/2007 2:25:46 AM"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Extract hour from date

Say your date and time is in A1. In some other cell enter "=Mod(A1,1)"
without the quotes, and format the cell for time. HTH Otto
"Orhan" wrote in message
ups.com...
Hello,

I want to extract the from these cells only the hour:

9/3/2007 2:25:46 AM cell value must become 02
9/3/2007 2:25:46 PM cell value must become 14

I can use date format to show only "hh", but cell value is still
"9/3/2007 2:25:46 AM"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract hour from date

Hi,

It shows correct hour "02" but when I copy-pastevalues the cell value
is still "2:25:46 AM"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Extract hour from date

Hi Orhan

Try this:

if your date is in A1, then Hour(A1). Then format the cell as "00"

Faisal...
On 26 Oct, 21:35, Orhan wrote:
Hi,

It shows correct hour "02" but when I copy-pastevalues the cell value
is still "2:25:46 AM"


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Extract hour from date

Format the cell Custom - hh. That is, click Format - Cells - Number tab -
Custom, type hh for type. HTH Otto
"Orhan" wrote in message
ups.com...
Hi,

It shows correct hour "02" but when I copy-pastevalues the cell value
is still "2:25:46 AM"





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Extract hour from date

Say your date and time are in A1, as before. In another cell, type, without
quotes, "=HOUR(MOD(A1,1))"
This will get you the hour. If you pastespecial - Values this to another
cell you will get the hour only. HTH Otto
"Orhan" wrote in message
ups.com...
Hi,

It shows correct hour "02" but when I copy-pastevalues the cell value
is still "2:25:46 AM"



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract hour from date

On Oct 27, 12:06 am, "Otto Moehrbach" wrote:
Say your date and time are in A1, as before. In another cell, type, without
quotes, "=HOUR(MOD(A1,1))"
This will get you the hour. If you pastespecial - Values this to another
cell you will get the hour only. HTH Otto"Orhan" wrote in message

ups.com...

Hi,


It shows correct hour "02" but when I copy-pastevalues the cell value
is still "2:25:46 AM"


Thanks,
That did the trick.

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
is it possible to set a cel to write the date and hour or date or kbee Excel Worksheet Functions 2 February 15th 08 02:23 PM
Count by date and hour ChristiaanV Excel Worksheet Functions 4 August 12th 06 12:26 AM
Extract the hour from a cell showing the date and time Paul Sexton Excel Worksheet Functions 2 February 27th 06 06:15 PM
Convert Date/Time to the Hour eric_rs1 Excel Discussion (Misc queries) 2 October 3rd 05 04:40 PM
Subtracting date:hour from date:hour [email protected] Excel Worksheet Functions 4 August 26th 05 08:35 AM


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