Solved

How to remove time?

Posted on 2011-02-11
5
292 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

732 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