[Solved] Show date results

Discuss the spreadsheet application
Post Reply
Fitch
Posts: 115
Joined: Mon Feb 22, 2010 6:01 pm

[Solved] Show date results

Post by Fitch »

Hi all.
I have to set up a list of meeting which would look like below (last year's)
Jan 2022 .... AGM ........ Sun 30 January 2022
Feb 2022 .... Workshop .... Sat 26 February 2022
Mar 2022 .... Workshop .... Sun 27 March 2022
Apr 2022 .... Meeting ........ Sat 23 April 2022

So I set up the dates which happen to be the last weekend of every month - odd months Saturdays, even Sundays.
Using formulas to get the right days, and then formatting the cells to show the contents as above.
Then I add all the cells together into one cell with:

Code: Select all

=G4&" "&H4&" ... "&I4&" ... "&M4&" "&N4
Of course, I get:
44955 2023 ... AGM.... ... 1 44955
44982 2023 ... Workshop ... 7 44982
45011 2023 ... Workshop ... 1 45011
45045 2023 ... Meeting ... 7 45045

So my question is:
How do I show the various text outputs instead of the raw date numbers in the final cells?
Thanks.
Fitch.
Last edited by Fitch on Mon Oct 25, 2021 5:50 pm, edited 1 time in total.
LibreOffice 5.1.4.2
Xenial Xerus
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Show date results

Post by RusselB »

You can get rid of the M4 column and get your wanted results by wrapping the G4 and N4 references in the TEXT function.
Check the Help file for more details.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Show date results

Post by RoryOF »

Format your cells as Dates and choose he appropriate display from the formatting dialog.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Show date results

Post by RusselB »

Rory: The formatting of the cells is irrelevant when forcing a concatenation of cells as indicated in the OP's provided formula.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Fitch
Posts: 115
Joined: Mon Feb 22, 2010 6:01 pm

Re: Show date results

Post by Fitch »

I did look at the text function previously, but couldn't figure what I put in as the "Format".
I presume the number is the cell, e.g. G4 for the first bit
LibreOffice 5.1.4.2
Xenial Xerus
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Show date results

Post by Villeroy »

The second argument is a format code as displayed in the number format dialog.

=TEXT(G4;"NN DD MMMM YYYY") returns the string "Sun 30 January 2022" which can be concatenated with any other string.
Last edited by Villeroy on Mon Oct 25, 2021 5:02 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Fitch
Posts: 115
Joined: Mon Feb 22, 2010 6:01 pm

Re: Show date results

Post by Fitch »

Ooooh! MMM
Now I'm getting the hang of it
Just posted a few seconds after you did Villeroy.
Thanks everyone.
LibreOffice 5.1.4.2
Xenial Xerus
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Show date results

Post by Villeroy »

Select a numeric cell and play with the number format dialog. This should help with simple formats. There is also extensive documentation for more complex number formats. The number format codes are the same that are used as a second argument to the TEXT function which returns the text that would be displayed when a numeric cell would be formatted like this. A number format does not change the numeric type of a cell wheras the TEXT function actually returns text.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Fitch
Posts: 115
Joined: Mon Feb 22, 2010 6:01 pm

Re: Show date results

Post by Fitch »

Got it
Thanks.
I'm sure I'll have many minutes of fun with this....
LibreOffice 5.1.4.2
Xenial Xerus
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Show date results

Post by RoryOF »

RusselB wrote:Rory: The formatting of the cells is irrelevant when forcing a concatenation of cells as indicated in the OP's provided formula.
I was answering the main problem of all his dates being numbers.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply