Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Am 20.03.2015 um 02:28 schrieb James:
Column A has text strings that are DD/MM/YYYY format.
I want to make them real dates.
I tried these 2 datevalue formulas but I can't make it work.

14/03/2015    Err:502
14/03/2015    Err:502


=DATEVALUE(TEXT(A1,"##/##/####"))
=DATEVALUE(A2)


Short and correct answer again:

1) Avoid text strings alltogether. Enter valid numbers into numeric
cells (no text formatting) and import/paste-special with the right
locale and "special numbers" option set.
The right locale for your 14/03/2015 is anything English but not US
English. The right locale for 03/14/2015 would be English(USA).

2) If things went wrong and you can't redo the import and you have
imported text values _mixed_with_wrong_dates_ (inverted day and month),
then you should switch to the right locale (British for 14/03/2015) and
apply this formula:

=IF(ISNUMBER(A1);DATE(YEAR(A1);DAY(A1);MONTH(A1));VALUE(A1))

which either inverts back the month and day portion of any wrong date or
converts any text date to the correct numeric cell value.
Then turn the formula results into constant numbers (copy &
paste-special values) switch back to your preferred locale and format to
your liking. Neither the locale nor the formatting will change any
correct value but the correct locale is required for the correct British
context of the string-to-number conversion of 14/03/2015. German,
Russian, French do work as well with D/M/Y dates but not US Enghlish.




-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.