PC Review


Reply
Thread Tools Rate Thread

DataTime in excel

 
 
=?Utf-8?B?SklNLkgu?=
Guest
Posts: n/a
 
      18th Sep 2007
DataTime in excel
I have a DateTime column in A. How do I get this two values?
1. only date in column B
2. Time range in column C like (0-1 o’clock , 1-2 o’clock, 2-3 o’clock …)
Thanks,


 
Reply With Quote
 
 
 
 
Earl Kiosterud
Guest
Posts: n/a
 
      18th Sep 2007
Jim,

You can do this with only formatting, or you can use formulas to extract the date, and the
time. For the formatting approach, in B2 and in C2, put this formula: = A2. COpy down.
Format column B: Format - Cells - Number - Date, then pick the date format you want. For
column C: Format - Cells - Number - Time, and pick the time format you want. Note that the
B and C columns still yield the entire date-time number, but the formatting shows only the
part you want. Any formulas that refer to these columns will get the entire data-time
number, but the formatting will cause only the date, or the time, as you want, to show.

For the formula approach, put this in B2: =INT(A2). Format column B for the date format you
want as above. The formula will yield only the date part, not the time (fractional) part.
Then put this in C2: =MOD(A2,1). Format only for time, as above. You would use this
approach if other formulas refer to these columns, and should get only the desired date or
time part.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"JIM.H." <(E-Mail Removed)> wrote in message
news:20139A28-2F3E-4A92-9099-(E-Mail Removed)...
> DataTime in excel
> I have a DateTime column in A. How do I get this two values?
> 1. only date in column B
> 2. Time range in column C like (0-1 o'clock , 1-2 o'clock, 2-3 o'clock .)
> Thanks,
>
>



 
Reply With Quote
 
Earl Kiosterud
Guest
Posts: n/a
 
      18th Sep 2007
Jim,

I didn't read the column C part of your post carefully enough. Put this formula in C2, and
copy down:

FOr 24-hour time:
=INT(MOD(A2,1)*24) & " - " &INT(MOD(A2,1)*24) + 1 & " O'Clock"

Or for 12-hour time
=MOD(INT(MOD(A2,1)*24),12) & " - " & MOD(INT(MOD(A2,1)*24) + 1,12) & " O'Clock"
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

"Earl Kiosterud" <(E-Mail Removed)> wrote in message
news:eq30eQa%(E-Mail Removed)...
> Jim,
>
> You can do this with only formatting, or you can use formulas to extract the date, and the
> time. For the formatting approach, in B2 and in C2, put this formula: = A2. COpy down.
> Format column B: Format - Cells - Number - Date, then pick the date format you want. For
> column C: Format - Cells - Number - Time, and pick the time format you want. Note that
> the B and C columns still yield the entire date-time number, but the formatting shows only
> the part you want. Any formulas that refer to these columns will get the entire data-time
> number, but the formatting will cause only the date, or the time, as you want, to show.
>
> For the formula approach, put this in B2: =INT(A2). Format column B for the date format
> you want as above. The formula will yield only the date part, not the time (fractional)
> part. Then put this in C2: =MOD(A2,1). Format only for time, as above. You would use
> this approach if other formulas refer to these columns, and should get only the desired
> date or time part.
> --
> Regards from Virginia Beach,
>
> Earl Kiosterud
> www.smokeylake.com
>
> Note: Top-posting has been the norm here.
> Some folks prefer bottom-posting.
> But if you bottom-post to a reply that's
> already top-posted, the thread gets messy.
> When in Rome...
> -----------------------------------------------------------------------
> "JIM.H." <(E-Mail Removed)> wrote in message
> news:20139A28-2F3E-4A92-9099-(E-Mail Removed)...
>> DataTime in excel
>> I have a DateTime column in A. How do I get this two values?
>> 1. only date in column B
>> 2. Time range in column C like (0-1 o'clock , 1-2 o'clock, 2-3 o'clock .)
>> Thanks,
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataTime Problem Jacko Microsoft Dot NET Framework 7 10th Jun 2009 12:41 AM
DataTime - TryParseExact Brian R. Microsoft C# .NET 3 2nd Oct 2008 03:56 PM
datatime fields Microsoft C# .NET 1 14th Apr 2008 08:31 PM
DataTime string format barry Microsoft ASP .NET 4 14th Feb 2006 04:12 PM
DataTime Picker with API Steve Conklin \(Dev@UltraDNT\) Microsoft Access Form Coding 2 21st May 2004 07:51 PM


Features
 

Advertising
 

Newsgroups
 


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