Bug 118700 - WeeksinYear function in error
Summary: WeeksinYear function in error
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.7.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-11 15:46 UTC by bob.brooks@cox.net
Modified: 2018-07-11 22:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bob.brooks@cox.net 2018-07-11 15:46:10 UTC
Description:
I used the example in the documentation =WEEKSINYEAR(1970-2-17). This should have produced 53 but it produced 52. In fact I tried every years for about a 10 year period and always got 52. 53 should occur about every 4 or 5 years. I used cell A1.

Also is there some way to change the default Date format to 02/17/1970?

Steps to Reproduce:
=WEEKSINYEAR(1970-2-17) in any cell
2.
3.

Actual Results:
52

Expected Results:
53


Reproducible: Always


User Profile Reset: Yes



Additional Info:
WEEKSINYEAR

Calculates the number of weeks of the year in which the date entered occurs. The number of weeks is defined as follows: a week that spans two years is added to the year in which most days of that week occur.
Syntax

WEEKSINYEAR(Date)

Date is any date in the respective year. The Date parameter must be a valid date according to the locale settings of LibreOffice.
Example

WEEKSINYEAR(A1) returns 53 if A1 contains 1970-02-17, a valid date for the year 1970.
Comment 1 raal 2018-07-11 20:56:53 UTC
Hello,
function =WEEKSINYEAR("1970-02-17")  returns 53. Also =WEEKSINYEAR(C4) where C4 is 1970-02-17 returns 53. Please check again.
Tested with Version: 6.2.0.0.alpha0+
Build ID: dc952845ca93a38868fee47a02b1ca1ed4c14f88
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
Comment 2 m_a_riosv 2018-07-11 22:24:49 UTC
=WEEKSINYEAR(1970-2-17) uses the date for value 1951, calc value for the date 1905/05/04

Like raal have done on comment#1, dates in a function must be used with the value in calc for the desired date or the date inside quotes, the more secure introducing the date with DATE(YY;MM;DD) function if it is not referenced to other cell with the date.

About the format it depends on the language, Menu/Tools/Options/Language settings/Language