#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Excel dates

I received an Excel file from a customer that has a date field where the
dates look like 7/13/2005 or 10/14/2005 - they all look the same and I've
tried applying the same format to all. However, if I try to use the
DATEVALUE function, it works on one portion of them and returns numbers like
38546 and 38639 which is what I want. Another whole portion that looks
identical returns the error #VALUE! - I cannot seem to figure out how or why
they are being handled differently. Thanks for any help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Excel dates

If Datevalue works, it means your fields are Text, not dates.

You can use DataText to Columns to convert them, if you'd like.
You can also use Datevalue, as you did -- now just format the result as a
date.

If you're getting a #Value error, it may look identical, but isn't. You
likely have trailing blanks or unprintable characters in the cell. Something
as simple as:
=Datevalue(Trim(a1))
might work for you.

Regards,
Fred.

"MaryJC" wrote in message
...
I received an Excel file from a customer that has a date field where the
dates look like 7/13/2005 or 10/14/2005 - they all look the same and I've
tried applying the same format to all. However, if I try to use the
DATEVALUE function, it works on one portion of them and returns numbers
like
38546 and 38639 which is what I want. Another whole portion that looks
identical returns the error #VALUE! - I cannot seem to figure out how or
why
they are being handled differently. Thanks for any help!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Excel dates

Hi Mary,

Ensure that you have a backup of your workbook before doing any of the
following because I cannot be certain that my assumption of text is accurate.

I suspect that the dates in your worksheet are text and if my assumption is
correct then you should be able to use Text to Columns to fix the problem.

Select the column of dates.

Select Menu item Data - Text to columns (or in xl2007 Ribbon Data then Text
to columns)

Select Fixed width then Click Next (Data preview is displayed.)

Click Next again.

Another data preview should be displayed with black background (selected)

Under Column data format section click date button.

Click the drop down against date and select MDY (That is the date format of
your existing data)

Click Finish.

Your column should now be valid dates but in the wrong format. (MDY)

Select Number format and format the dates in your required format. (DMY)

--
Regards,

OssieMac


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Excel dates

Datevalue gives problems when the dates are text and not formatted in the
users regional date format. Example if you have a text date 4/6/2009 if the
users regional date format is m/d/y then it converts it to apr 6 2009 but if
the users regional date format is d/m/y then it converts it to 4 Jun 2009.
Using the Text to columns you are telling it what format the text dates are
in and therefore it converts them accordingly.

--
Regards,

OssieMac


"Fred Smith" wrote:

If Datevalue works, it means your fields are Text, not dates.

You can use DataText to Columns to convert them, if you'd like.
You can also use Datevalue, as you did -- now just format the result as a
date.

If you're getting a #Value error, it may look identical, but isn't. You
likely have trailing blanks or unprintable characters in the cell. Something
as simple as:
=Datevalue(Trim(a1))
might work for you.

Regards,
Fred.

"MaryJC" wrote in message
...
I received an Excel file from a customer that has a date field where the
dates look like 7/13/2005 or 10/14/2005 - they all look the same and I've
tried applying the same format to all. However, if I try to use the
DATEVALUE function, it works on one portion of them and returns numbers
like
38546 and 38639 which is what I want. Another whole portion that looks
identical returns the error #VALUE! - I cannot seem to figure out how or
why
they are being handled differently. Thanks for any help!


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop dates from showing as numbers - when formated as dates JR Excel Discussion (Misc queries) 1 October 29th 08 04:38 PM
Excel not recognizing dates as dates lawson Excel Discussion (Misc queries) 1 June 26th 07 04:39 PM
Identifying unique dates within a range of cells containing dates cdavidson Excel Discussion (Misc queries) 0 October 12th 06 08:19 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM
How do I get the dates on an excel chart to stay as dates instead. Rani Charts and Charting in Excel 1 September 20th 05 05:56 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"