Bug 153707 - NPV function error with big number
Summary: NPV function error with big number
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.5.1 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-18 07:15 UTC by Xaxa
Modified: 2023-02-18 22:05 UTC (History)
0 users

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 Xaxa 2023-02-18 07:15:59 UTC
Description:
Given a list of these numbers:
862500
862500
862500
862500
862500
862500
862500
=NPV(0.1, 862500,862500,862500,862500,862500,862500,862500...) 
The cell value becomes "###"

However, we I do the same with the small values 862.5, it works.
=NPV(0.1, 862.5,862.5,862.5,862.5,862.5,862.5,862.5,862.5,862.5,862.5)
return 5.299,69

Steps to Reproduce:
Given a list of these numbers:
862500
862500
862500
862500
862500
862500
862500
=NPV(0.1, 862500,862500,862500,862500,862500,862500,862500...) 
The cell value becomes "###"

However, we I do the same with the small values 862.5, it works.
=NPV(0.1, 862.5,862.5,862.5,862.5,862.5,862.5,862.5,862.5,862.5,862.5)
return 5.299,69

Actual Results:
With the values such as 862500 as "Value"parameter in the NPV function, it returns "###"

Expected Results:
Should calculate NPV 


Reproducible: Always


User Profile Reset: No

Additional Info:
n/a
Comment 1 ady 2023-02-18 07:32:10 UTC
See
https://help.libreoffice.org/latest/en-US/text/scalc/05/02140000.html

###
The cell is not wide enough to display the contents.

Simply increase the column width.

Set to NAB.
Comment 2 Xaxa 2023-02-18 15:27:12 UTC
It is not intuitive to know to expand the width of the column. Could we please display the result however long it is? Other platform (Google spreadsheet, MS Excel) still displays the number even if it is long.

How much effort does it need to always display the number if it is long? If it is too much effort, we should display a message "number is too long, please expand the column".
Comment 3 ady 2023-02-18 22:01:56 UTC
(In reply to Xaxa from comment #2)
> It is not intuitive to know to expand the width of the column. Could we
> please display the result however long it is? Other platform (Google
> spreadsheet, MS Excel) still displays the number even if it is long.
> 
> How much effort does it need to always display the number if it is long? If
> it is too much effort, we should display a message "number is too long,
> please expand the column".

Being able to display X amount of characters in one column depends on several factors:
_ column width
_ font type
_ font size
_ amount of characters to be displayed
_ zoom factor
_ other attributes of the relevant cell

As for the last one, you could select the cell (or the entire column) and go to menu format > cell > alignment > shrink to fit cell size. This is only one of several alternatives.

FYI, Excel uses the same exact method, whenever the combination of the aforementioned factors results in not enough physical width.

There is no physical way to display any-and-all possible results of an unknown width within a limited column width. You have to modify at least one of the listed elements. The only exception is when the adjacent cell is absolutely blank empty, so the content text "spills" on to the neighboring cell.

Now, for future reference, you could first go to ask.libreoffice.org and try to solve your doubts there. In many cases your question would be already answered. A web search could also help (e.g. "Calc ### error" or "Excel ### error" or whatever). There is also help.libreoffice.org .

I already closed this report as NAB before, and you re-opened it. I provided more than enough details. I'll leave the report in the same status as you left it, but IMO it should be closed as NOTABUG again.
Comment 4 Xaxa 2023-02-18 22:05:05 UTC
Thank you