Separate Day and Time from a Date Field

B

Bman342

I receive a batch data feed with a date/time field in excel-compliant format.
I would like to separate the Day (ie, Monday, Tuedsday, etc), and the Time
(8:00AM) into separate columns, and still show the Date in its own column.
I've done a =lookup on a =weekday function to get the day, and that works.
But how do I pull out the time? I've looked at different functions and cannot
figure out how to do this. Any help would be appreciated.

-b
 
T

T. Valko

Try this...

A1 = 12/15/2007 5:35 PM

To get the weekday in long name format (Saturday):

=TEXT(A1,"dddd")

To get the weekday in short name format (Sat):

=TEXT(A1,"ddd")

To get the time:

=MOD(A1,1)

Format as TIME
 
M

macropod

Hi Bman342,

Assuming your date & time are in A1, you can retrieve the time with:
=A1-INT(A1)

However, your simplest solution might be to simply use a formula like =A1 and format your day and time target cells appropriately.
For example, to get the day, give the target cell a custom format of 'dddd'. Similarly, to get the time, give the target cell a
custom format of 'h:mm AM/PM'.

Cheers
 
B

Bman342

Biff:

Thanks! The Mod solution works, as I need to sort on the Time. And could not
by just changing the formatting. Now I can.

-b
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top