Download it now!
Bug 60912 - WEEKNUM_ADD fails when second parameter is omitted
Summary: WEEKNUM_ADD fails when second parameter is omitted
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.5.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
Reported: 2013-02-15 17:10 UTC by Colin Fletcher
Modified: 2020-10-21 04:22 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Excel file using WEEKNUM_ADD (34.00 KB, application/
2013-02-19 14:13 UTC, Colin Fletcher

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Fletcher 2013-02-15 17:10:35 UTC

Comment 1 Colin Fletcher 2013-02-15 17:13:40 UTC
When opening an Excel spreadsheet file where the WEEKNUM_ADD function has been used with only one parameter, an Err:504 occurs.

Excel permits the use of WEEKNUM add with only one parameter, in which case the second "ReturnType" parameter defaults (I believe) to 1, meaning "week beginning on a Sunday"
Comment 2 Julien Nabet 2013-02-16 17:37:35 UTC
Colin: did you try with a more recent LO version (last one is 3.6.5 for 3.6 branch and there's first 4.0 release available)?

If you can still reproduce this, could you attach a simple file which includes this function so we can test it?
Comment 3 Colin Fletcher 2013-02-19 14:11:06 UTC
To clarify, I first observed this in LibreOffice 
Build ID: 350m1(Build:2), on Debian testing.

I've also installed the .deb packages for, and the same error occurs. I haven't yet tried 4.0.0, but I'll do so when I can.

I'll upload an Excel file contianing WEEKNUM_ADD with both one and two parameters in a moment.
Comment 4 Colin Fletcher 2013-02-19 14:13:11 UTC
Created attachment 75112 [details]
Excel file using WEEKNUM_ADD

A file containing uses of WEEKNUM_ADD with both one and two parameters.
Comment 5 Colin Fletcher 2013-02-24 15:52:13 UTC
The one-parameter version of WEEKNUM_ADD in the attached Excel file fails in the same way in LibreOffice Version (Build ID: 7545bee9c2a0782548772a21bc84a9dcc583b89).
Comment 6 Julien Nabet 2013-02-24 21:41:06 UTC
On pc Debian x86-64 with master sources updated today, I can confirm the behaviour.

I thought than just by adding a default value in scaddins/source/analysis/analysis.cxx would work, 
line  591 sal_Int32 SAL_CALL AnalysisAddIn::getWeeknum( constREFXPS& xOpt, sal_Int32 nDate, sal_Int32 nMode ) THROWDEF_RTE_IAE
but it didn't.

Now I don't know if it's a bug or an enhancement.

Noel: What do you think about this one?
Comment 7 QA Administrators 2015-04-19 03:20:34 UTC Comment hidden (obsolete)
Comment 8 Colin Fletcher 2015-04-29 17:22:03 UTC
This bug still exists in LibreOffice

I've tested the version downloaded from here:
Comment 9 QA Administrators 2016-09-20 09:37:22 UTC Comment hidden (obsolete)
Comment 10 Colin Fletcher 2016-11-14 22:38:48 UTC
This bug still exists in LibreOffice version (Build ID: 1:5.2.3~rc1-4 in Debian testing).
Comment 11 QA Administrators 2017-11-15 09:15:35 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2020-10-21 04:22:51 UTC
Dear Colin Fletcher,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat:

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team