Bug 166787 - Suggestion: Add MOD (modulo) function to Writer (error: Expression is faulty)
Summary: Suggestion: Add MOD (modulo) function to Writer (error: Expression is faulty)
Status: RESOLVED DUPLICATE of bug 123384
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.3.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-29 21:35 UTC by Mikko Vedru
Modified: 2025-06-03 18:45 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Writer - the Int function (25.09 KB, image/png)
2025-05-30 13:46 UTC, nutka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikko Vedru 2025-05-29 21:35:14 UTC
Description:
Trying to calculate a simple MOD in writer gives error "** Expression is faulty **" because the function was not implemented.

Writer's list of implemented functions ( https://help.libreoffice.org/latest/en-US/text/swriter/02/14020000.html ) is not long, but it still includes functions that I can't even imagine why people would use. I am not advocating to remove anything. And while fully understanding that Calc exists, but MOD is such a basic function (on the level of addition, subtraction, multiplication and division) that I think it should be implemented in the Writer as well.


Example use case:
- A monthly document with important info. Should include date and weekday for each day of the month. The date row can be easily solved with formula "take the value of the cell above and add 1". But a similar function ("value of cell above" MOD 7) can't be done with the weekday.


Related bug: #123384, https://bugs.documentfoundation.org/show_bug.cgi?id=123384

Steps to Reproduce:
Try to use MOD in table cell.

Actual Results:
Doesn't work.

Expected Results:
Modulo works.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: 520(Build:2)
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Ubuntu package version: 4:25.2.3-0ubuntu0.22.04.1~lo1
Calc: threaded
Comment 1 nutka 2025-05-30 10:47:40 UTC
(In reply to Mikko Vedru from comment #0)
> (...) but MOD is such a basic function (on the
> level of addition, subtraction, multiplication and division) that I think it
> should be implemented in the Writer as well.
+1
 
> (...) The date row can be easily solved with formula
> "take the value of the cell above and add 1". But a similar function ("value
> of cell above" MOD 7) can't be done with the weekday.
> 
Stating the obvious: formula using the INT function should return the same result as MOD.
Comment 2 Mikko Vedru 2025-05-30 12:50:30 UTC
(In reply to nutka from comment #1)
> Stating the obvious: formula using the INT function should return the same
> result as MOD.

I don't understand this comment. What is this INT function you are talking about? It does not exist in the list ( https://help.libreoffice.org/latest/en-US/text/swriter/02/14020000.html ).
Comment 3 nutka 2025-05-30 13:45:37 UTC
Indeed, Help does not mention the INT function. However, it is available since LO 7.4 (see Bug 123381 - "FILEOPEN DOCX INT table formula is not working in LO").

Cf. the attached screenshot.
Comment 4 nutka 2025-05-30 13:46:42 UTC
Created attachment 201043 [details]
Writer - the Int function
Comment 5 fpy 2025-05-30 14:09:46 UTC
(In reply to Mikko Vedru from comment #0)
> Related bug: #123384,

it's even a DUPLICATE  !?
Comment 6 fpy 2025-06-03 18:45:50 UTC

*** This bug has been marked as a duplicate of bug 123384 ***