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

#### porkchop

##### New Member
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
If you just want to strip the time off:

=INT(AP2)

Format as date.

#### porkchop

##### New Member
****, 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
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

#### porkchop

##### New Member
Glad to have been of assistance to someone instead of being the helpee.

Replies
18
Views
554
Replies
6
Views
124
Replies
1
Views
133
Replies
1
Views
386
Replies
3
Views
227

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.

### Which adblocker are you using?

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

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