How can I "drop time"?

Lythande

Board Regular
Joined
Oct 3, 2006
Messages
160
Hey Board,

I have a spreadsheet that in column M each cell has a time-stamp like 2/27/09 7:21:00 PM and other such dates and times each cell down. The times are annoying as hell because I'm counting only by date (countif stuff) and the time being there messes things up. I see that this is a cell format time option instead of date, so I highlighted the column, clicked format, and opted for date as 27-Feb.

The time is gone in the cell, but the count still doesn't work. Why? When I click on the cell the **** time still appears in that bar at the top (to the right of Fx). How the heck can I get rid of that darn time stamp in there?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
In another cell on row 1 put this formula and copy it down:

=INT(M1)


Now format that cell as date and do your math on that column, or copy > edit > pastespecial > values that column back over the original column M to permanently remove the time data.
 
Upvote 0
In answer to WHY??? When you change the cell format, you're only changing how the data in the cell is displayed, excel retains the original data in the background so that if you need to change it back to show the times again they will still be there.

How are the dates entered into the sheet? In most (if not all) cases it should be possible to correct this at the source without the need for extra columns.
 
Upvote 0
I come across this all the time at work. Another easy way to do this, format the field as date (without the time), open up notepad, copy and paste column data into notepad, copy and paste column data back into excel. Time data is gone from date.

Notepad can't hold hidden values, ends up very useful for these types of things (also copying tables into excel from other places).
 
Upvote 0
I come across this all the time at work. Another easy way to do this, format the field as date (without the time), open up notepad, copy and paste column data into notepad, copy and paste column data back into excel. Time data is gone from date.

Notepad can't hold hidden values, ends up very useful for these types of things (also copying tables into excel from other places).
Sisko, you don't have to leave Excel to accomplish the same thing.

Highlight the cells currently displaying data the way you want.
Press CTRL-C to copy it
Click on EDIT > PASTE SPECIAL > VALUES
Formulas and hidden values gone.
 
Upvote 0
Hi jbeaucaire,

I wish that was the case. Unfortunately, since the date/time is a value of whole number + decimal, when you paste values only, you still get the decimal. In order to get rid of the decimal, you'd have to run a trunc function, do some text-to-columns magic, or set up a macro. The easy way to do this is to go to notepad - notepad doesn't look at the actual value, it just takes what's displayed.

I also use this to remove hyperlinks - when you paste values the hyperlink still stays, but if you go to notepad and back, it goes away. Notepad is a lifesaver for these little workarounds.
 
Upvote 0

Forum statistics

Threads
1,202,973
Messages
6,052,863
Members
444,604
Latest member
Wait what

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
Back
Top