Removing the Time value from cells containing Date/Time values to leave only the date

porkchop

New Member
Joined
Jan 24, 2008
Messages
14
Hi,

This is just something I worked out rather than a question.
I had over 4000 rows of data that needed to be sorted by date. Problem was that they all had a time stamp - ie: 29/05/2008 7:10:17 AM - and reformatting the cell didn't fix it.

I inserted a column after the one I needed and used this formula:
=ROUND(A1-0.5,0)
Then just a quick copy/paste special/values to remove the formulas.

I am posting this here because it took me ages to find an answer for this problem.. the closest I could find before this was the formulas:

For days numbered 0-9 in the month
="0" & DAY(AP2) & "/" & MONTH(AP2) & "/" & YEAR(AP2)

and

For days numbered 10+ in the month
=DAY(AP2) & "/" & MONTH(AP2) & "/" & YEAR(AP2)


Hope this helps someone

Cheers
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
If you just want to strip the time off:

=INT(AP2)

Format as date.
 

porkchop

New Member
Joined
Jan 24, 2008
Messages
14
****, that's even easier. Thank you


I suppose that saying is true, - that people don't know what they don't know - as I actually didn't realise a) that there was a function that would round down only; and b) that it's called the INT function.

I have tried to make the subject heading as close to google friendly as possible so that no one ends up spending as much time on this one as I did.
 

Wgafaw

New Member
Joined
Mar 30, 2007
Messages
13
Hey guys. Thank you so very much for this. I have to deal with about 6 big reports a day that have the date with a time stamp and I manually convert it to just time before uploading into my database. This is going to save me a lot of time.

Thanks Again,
Wgafaw
 

Watch MrExcel Video

Forum statistics

Threads
1,130,346
Messages
5,641,598
Members
417,225
Latest member
LukiiMaxim96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top