Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to remove time?

Posted on 2011-02-11
5
Medium Priority
?
296 Views
Last Modified: 2012-05-11
I've tried to format the column in the included file so time removed.  However, it has no affect.  What else should I do?
DateFormatTest.xls
0
Comment
Question by:brettr
  • 3
5 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 1200 total points
ID: 34875946
Hello brettr

Your data is text formatted and appears to start with a CHAR(160) character

You can get rid of that character using Edit > Replace

Select column then

In the "find what" box use the number pad to insert ALT+0160 and leave the "Replace with" box empty. That should convert the data to true dates and you can format any way you want.

The underlying data will still have a time even if you don't display it. If you want to eradicate the time completely you could use a formula in the next column to get date only, i.e. in B2 copied down

=INT(A2)

regards, barry
0
 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 400 total points
ID: 34875961
=DATE("20" &MID(A2,8,2),MID(A2,5,2),MID(A2,2,2))

Please check the attached file.

jppinto
DateFormatTest-1-.xls
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34875971
See the attached.

I used the Edit > Replace as suggested to convert column A and then I formatted that column to still show the time (although you can now format any way you want - e.g. without time)

Column B has the time removed using INT function. If you format to show time as I have done then all time values are 00:00

regards, barry
26816406.xls
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34875993
....if you want a formula that will remove the extra charcater and the time all in one go then you could use this formula in B2

=INT(SUBSTITUTE(A2,CHAR(160),""))

That will accommodate situations where you have 1 extra character as your data seems to, or any other number including zero. It will also allow different date formats, e.g. month shown as a single digit

regards, barry
0
 
LVL 5

Assisted Solution

by:foochar
foochar earned 400 total points
ID: 34876004
The date strings appear to be text, not actual numeric date values.  If you just need them reformatted into strings without the time you can use this formula (adjusting the cell reference of A2 as appropriate for you data): =CONCATENATE(MID(A2,2,2),"/",MID(A2,5,2),"/",MID(A2,8,2)) .  This is assuming all the dates are formated with 2 digit months, days and years.

If you actually need this to be treated by excel as a date that you can sort on by actual date etc then you'll want to use =DateValue(CONCATENATE(MID(A2,2,2),"/",MID(A2,5,2),"/",MID(A2,8,2))) and then format the field.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Quickbooks hosting can do wonders to your enterprise but considering the points elaborated in the article which will help you to better analyze the outcomes. So scan your business, its needs and then move to the new world of limitless benefits.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question