Remove Time from DateTime

S

stacy.mcmillan

Hello...

I need to know if there is an easy way to change the format of the
data I have imported into Excel from a DateTime stamp to just a Date
stamp. I am importing data from a Microsoft Dynamics CRM 4.0 report,
and the fields in the report are DateTime fields in the CRM
application. The data that is being imported looks as follows:

8/7/2008 10:00:00 PM

In my workbook, I have formula calculations that compare two dates,
less than or equal to, and the time stamp is throwing off the results
when the dates are the same... It is causing the 'equal to'
calculation to come back false instead of true.

So, what I need is a good way to strip out the Time from the data, and
just include the Date. Is this possible? Thank you in advance for
any help!!
 
D

David Biddulph

=int(A2)

Note that you said:
"... change the format of the data I have imported into Excel from a
DateTime stamp to just a Date stamp. "
but it looks as if you want to change the *content* of the data, not just
the *format*.
 
P

Pete_UK

You need to realize that dates are stored internally as the number of
days passed since some reference date (hence they are always whole
numbers), and times are stored as fractions of a 24-hour day. Thus, to
strip away the time element all you need to do is:

=INT(A1)

where A1 contains the date/time.

Alternatively, you can incorporate the INT function in your formula,
so that you are comparing only dates.

Hope this helps.

Pete
 
M

Mike H

Hi,

If it's a properly formatted date/time then simply reformat the cell as date.
If it's not then post back.

Mike
 
F

FSt1

hi
is a helper column put this
=DATE(YEAR(A4),MONTH(A4),DAY(A4))

copy down as far as you need. copy the helper column and pastespecaial
values over the old data.
adjust cell reference to suit.
Regards
FSt1
 
S

stacy.mcmillan

hi
is a helper column put this
=DATE(YEAR(A4),MONTH(A4),DAY(A4))

copy down as far as you need. copy the helper column and pastespecaial
values over the old data.
adjust cell reference to suit.
Regards
FSt1









- Show quoted text -

Thank you to everyone!! Got it working and embedded the INT function
in the comparison formula. Thank you all for helping out so
quickly... I truly appreciate it!
 

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