[Solved] Day of Week?

Discuss the spreadsheet application
Post Reply
halw
Posts: 2
Joined: Fri May 30, 2008 10:27 pm

[Solved] Day of Week?

Post by halw »

Looking for a function/formula that will take a date in a cell and convert it to the corresponding week day e.g. Monday, Tuesday, etc., in another cell.

Searched help subjects and could not find.

TIA
Last edited by Hagar Delest on Tue Jun 10, 2008 2:25 pm, edited 2 times in total.
Reason: tagged the thread as Solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Day of Week?

Post by Villeroy »

See help on WEEKDAY. If you need the string for display purpose you may combine WEEKDAY with CHOOSE. You could also apply another number format:
A1: some date
B1: =A1 [plus number format "NNN"] yields the same value as in A1, but shows the month name only
You could also get the string value:
B1: =TEXT(A1;"NNN")
TEXT returns the formatted string representation of a number.
 Edit: Sorry, I mixed month names with day names. replaced "MMMM" with "NNN" 
Last edited by Villeroy on Mon Dec 17, 2012 6:10 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
halw
Posts: 2
Joined: Fri May 30, 2008 10:27 pm

Re: Day of Week?

Post by halw »

Villeroy wrote:See help on WEEKDAY. If you need the string for display purpose you may combine WEEKDAY with CHOOSE. You could also apply another number format:
A1: some date
B1: =A1 [plus number format "MMMM"] yields the same value as in A1, but shows the month name only
You could also get the string value:
B1: =TEXT(A1;"MMMM")
TEXT returns the formatted string representation of a number.
Thank you. Was drawing a blank on this.
danuneken
Posts: 1
Joined: Sun Dec 16, 2012 10:03 pm

Re: [Solved] Day of Week?

Post by danuneken »

WHY so complicated?
Open Office 3.4.1 on Mac OS X (this changes all the time so why????)
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: [Solved] Day of Week?

Post by jrkrideau »

danuneken wrote:WHY so complicated?
I don't know but at a guess it is because time is much more complicated to calculate than simple numbers. Three hundred and sixty-five days in a year except when there are 366; 24 hours in a day but don't forget daylight savings time versus standard time, oh and every so often we add a second or so to the time and so on.
LibreOffice 7.3.7. 2; Ubuntu 22.04
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Day of Week?

Post by acknak »

halw wrote:Looking for a function/formula that will take a date in a cell and convert it to the corresponding week day e.g. Monday, Tuesday, etc., in another cell. ...
With the date in A1, =TEXT(A1;"NNN")
AOO4/LO5 • Linux • Fedora 23
andreuccio
Posts: 2
Joined: Sun May 30, 2021 5:29 am

Re: [Solved] Day of Week?

Post by andreuccio »

Hi i was wondering if there was a function to return the value of the weekdays to just the first two letters (e.g. Monday as Mo, Tuesday as Tu) to cut down on space.

I get that the function as is is =TEXT([cell w/ date];"NNN")

can it be more terse?
NeoOffice 2.2.3 with MacOS 10.4
User avatar
robleyd
Moderator
Posts: 5082
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] Day of Week?

Post by robleyd »

If you want just the first two characters, the formula will be longer:

Code: Select all

=LEFT(TEXT(A1;"NNN");2)
That will return e.g Mo, Tu etc.

If three characters is acceptable, just use NN in the cell format instead of NNN and you won't need a formula.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Day of Week?

Post by Villeroy »

NNN specifies the long weekday name.
NN specifies the abreviation.
=TEXT(A1 ; "NN") does the job.
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
andreuccio
Posts: 2
Joined: Sun May 30, 2021 5:29 am

Re: [Solved] Day of Week?

Post by andreuccio »

Wow! I'm so happy there's such an easy solution. Thanks y'all!
NeoOffice 2.2.3 with MacOS 10.4
Post Reply