[Solved] Date to text - how

Discuss the spreadsheet application
Post Reply
GeorgeLeS1953
Posts: 5
Joined: Wed Jul 21, 2021 5:06 pm

[Solved] Date to text - how

Post by GeorgeLeS1953 »

This is a simple problem. I used to know how to do this, but it's been years since I've worked with spreadsheets, and I've forgotten.

What I am trying to do is take some input, make some date calculations, and then have an output column. The calculations were simple enough; that came back to me. But my problem is dates. I am trying to get a cell saying "Date=yyyy-mm-dd". That's it. I tried using concatenate, with the text, and the new date (from a
different cell). but what I get is "Date=44398". I cannot get it to say "2021-07-21". I tried the Text Function, but there was no format that would work, not that I could find. I thought I remembered using Text to do this, but there are no formats given for dates. (yyyy-mm-dd just gives an error.)

I even tried just copying the column into another, with "paste special", but that just gave a blank cell. (I could have sworn that used to work, pasting everything as text. Doesn't now.)

Again, I am sure I was able to do this once upon a time. Can anyone tell me what I've forgotten?

Thanks.
Last edited by Hagar Delest on Thu Jul 22, 2021 10:37 am, edited 1 time in total.
Reason: tagged solved.
Open Office 4.1.19 on Windows 10 Pro
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Date to text - how

Post by FJCC »

I think you want a formula like

Code: Select all

="Date = " & TEXT(A1;"YYYY-MM-DD")
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Date to text - how

Post by Zizi64 »

You can format the cell itself (for example: A1), what contains the 44398 numeruc value by the code yyyy-mm-dd in the applied cell stlye. The number remains a numeric value when you use a style (or manual formating). You can make calculations with it.

Or you can use the

Code: Select all

=TEXT(A1;"yyyy-mm-dd")
Note: the result will be a text but nut a number - you can not make any calculation with it.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
GeorgeLeS1953
Posts: 5
Joined: Wed Jul 21, 2021 5:06 pm

Re: Date to text - how

Post by GeorgeLeS1953 »

I tried that
=TEXT(A1;"yyyy-mm-dd")

What I got was a cell displaying the word "original".
Open Office 4.1.19 on Windows 10 Pro
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Date to text - how

Post by Zizi64 »

Please upload your ODF type sample file here...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
GeorgeLeS1953
Posts: 5
Joined: Wed Jul 21, 2021 5:06 pm

Re: Date to text - how

Post by GeorgeLeS1953 »

Don't know what that means.
Open Office 4.1.19 on Windows 10 Pro
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Date to text - how

Post by FJCC »

Zizi64 wants you to upload a file illustrating your problem. It would only have to have two cells occupied, one with the date and the other with the formula you are trying to use.
To upload a file, click Post Reply and look for the Upload Attachment tab just below the box where you type a response.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
GeorgeLeS1953
Posts: 5
Joined: Wed Jul 21, 2021 5:06 pm

Re: Date to text - how

Post by GeorgeLeS1953 »

Thanks. Actually, I just figured out what I was doing wrong.

Thank you all.
Open Office 4.1.19 on Windows 10 Pro
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Date to text - how

Post by robleyd »

Could you add your solution here in case it may help someone else with the same problem?
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
GeorgeLeS1953
Posts: 5
Joined: Wed Jul 21, 2021 5:06 pm

Re: [Solved] Date to text - how

Post by GeorgeLeS1953 »

It was a typo that I didn't notice. I had a single ' in one spot. That has always been aproblem for me.
Open Office 4.1.19 on Windows 10 Pro
Post Reply