date strings to date

classic Classic list List threaded Threaded
3 messages Options
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

date strings to date


I have a column of date strings like "Thu, Aug 1, 2020".
I want to convert them to a real date column.


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Luuk Luuk
Reply | Threaded
Open this post in threaded view
|

Re: date strings to date


On 2-7-2020 00:53, James wrote:
>
> I have a column of date strings like "Thu, Aug 1, 2020".
> I want to convert them to a real date column.
>
>
Suppose the date is in B2, then:

=DATE(RIGHT(TRIM(B2);4);(FIND(TRIM(MID(B2;FIND(",";B2)+1;4));"JanFebMarAprMayJunJulAugSep")-1)/3+1;1)

You only need to:

1) Extend the monthnames ("JanFeb...") for the rest of the year

2) Fill in a formula for the day in the month (currently set to 1





--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Windows10 / LibreOffice  (latest?)
bjlockie bjlockie
Reply | Threaded
Open this post in threaded view
|

Re: date strings to date

On 2020-07-02 2:50 a.m., Luuk wrote:

>
> On 2-7-2020 00:53, James wrote:
>>
>> I have a column of date strings like "Thu, Aug 1, 2020".
>> I want to convert them to a real date column.
>>
>>
> Suppose the date is in B2, then:
>
> =DATE(RIGHT(TRIM(B2);4);(FIND(TRIM(MID(B2;FIND(",";B2)+1;4));"JanFebMarAprMayJunJulAugSep")-1)/3+1;1)
>
>
> You only need to:
>
> 1) Extend the monthnames ("JanFeb...") for the rest of the year
>
> 2) Fill in a formula for the day in the month (currently set to 1
=DATE(RIGHT(TRIM(A449),4),(FIND(TRIM(MID(A449,FIND(",",A449)+1,4)),"JanFebMarAprMayJunJulAugSepOctNovDec")-1)/3+1,TRIM(SUBSTITUTE(MID(A449,FIND("
",A449)+5,2),",","")))


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy