Date: · Thread:
2014 Archives by date, by thread · List index

# Re: [libreoffice-users] Calc function to return the daynumber weeknumber of the year

```At 09:25 19/07/2014 -0400, Charles Marcus wrote:
```
```Calc function to return the daynumber weeknumber of the year
```
```
Sorry, but I've no idea what a "daynumber weeknumber" is.

```
Like how MONTH(TODAY()) returns the month\$ of the year (ie, 1 for January, 12 for December)...
```
Oddly, you've defined the quantity you don't want but not the one you do.

```
```Is there one? Or if not, maybe a simple formula I can use to calculate?
```
```
Surely one or the other.

Here are some possibilities:

```
WEEKDAY(Date; Type) gives the day of the week (as an integer) for the given date value. For Type = 1, Sunday is day 1; for Type = 2, Monday is day 1; for Type = 3, Monday is day 0.
```
```
WEEKNUM(Date; Mode) gives the number of the week within the year for the given date value. For Type = 1, the week starts on Sunday; for any other value, on Monday.
```
WEEKNUM_ADD(Date; Mode) mimics Excel's WEEKNUM() function.

Note that you can also simply format cells as "WW" to display a week number.

```
You probably need to experiment with these to ensure they do what you need, since definitions of day and week numbers are many and various. Test to ensure that whatever you choose acts as you expect around the end of the year and in years with fifty-three weeks. Which years have fifty-three weeks itself depends on the other definitions.
```
I trust this helps.

Brian Barker

--
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.