Solved

How to remove time?

Posted on 2011-02-11
5
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 300 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 100 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 100 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

762 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