Bug 49052 - formula DGET() gives #VALUE! error when fetching calculation resulting in string
Summary: formula DGET() gives #VALUE! error when fetching calculation resulting in string
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.6.0 target:3.5.4
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-22 06:28 UTC by marc.claes9
Modified: 2021-09-16 10:02 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Enter "x" in cell D2, D3, ..., or D10 & observe result in cell C15 (26.29 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-04-22 06:28 UTC, marc.claes9
Details
database.ods (12.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-05-05 08:46 UTC, marc.claes9
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marc.claes9 2012-04-22 06:28:30 UTC
Created attachment 60448 [details]
Enter "x" in cell D2, D3, ..., or D10 & observe result in cell C15

When the DGET() formula fetches data from a cell that contains a formula THAT RESULTS IN A STRING, the result is the #VALUE!-error. The fetched cell itself shows the correct string value.

If the fetched cell contains a string (not a formula), the string is fetched correctly.

So,
Cell content    Value shown in cell   Result of DGET()-formula, fetching cell
============    ===================   =======================================
Mozes           Mozes                 Mozes
3               3                     3
=1+1            2                     2
="Mo"&"zes"     Mozes                 #VALUE!

Added file shows the effect.

I did not have the opportunity of testing this (yet)
- on other hardware
- on a 32-bit OS
- on Windows (any version/word width)
- also not (yet) on other related (database) formulas, that can fetch/handle string values, like & DCOUNTA() DCOUNT(), ...

Thanks for any interest & comments!
Comment 1 Ferran Vidal 2012-04-22 10:50:34 UTC
[Reproducible] with "LibreOffice 3.5.2.2 - GNU/Linux Ubuntu 11.10,English
UI"
Comment 2 marc.claes9 2012-04-26 07:52:04 UTC
2012-04-26; Tried in Microsoft Office (Save As > XLS in LO, then opened in Excel): everything works as expected...
Comment 3 Markus Mohrhard 2012-05-04 14:28:36 UTC
Created attachment 61079 [details]
database.ods

Can you add some test cases to http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/database.ods and send it to the qa list with a licence statement that your contribution is under MPL/LGPLv3+. 

This would help us very much fixing the bug.

Some explanation how these test cases look like can be found at: http://wiki.documentfoundation.org/Development/Calc_Import_Unit_Tests

Thanks a lot for your help fixing this bug.
Comment 4 marc.claes9 2012-05-05 08:46:05 UTC
I hope you will forgive my ignorance, but is this (see sheet2 in 
attached spreadsheet) what you intended?

Thanks for further pointers,
Marc Claes

On 05/04/2012 11:28 PM, bugzilla-daemon@freedesktop.org wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=49052
>
> Markus Mohrhard<markus.mohrhard@googlemail.com>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |markus.mohrhard@googlemail.
>                     |                            |com
>
> --- Comment #3 from Markus Mohrhard<markus.mohrhard@googlemail.com>  2012-05-04 14:28:36 PDT ---
> Can you add some test cases to
> http://cgit.freedesktop.org/libreoffice/core/plain/sc/qa/unit/data/ods/database.ods
> and send it to the qa list with a licence statement that your contribution is
> under MPL/LGPLv3+.
>
> This would help us very much fixing the bug.
>
> Some explanation how these test cases look like can be found at:
> http://wiki.documentfoundation.org/Development/Calc_Import_Unit_Tests
>
> Thanks a lot for your help fixing this bug.
>
Comment 5 Markus Mohrhard 2012-05-06 20:28:06 UTC
(In reply to comment #4)
> I hope you will forgive my ignorance, but is this (see sheet2 in 
> attached spreadsheet) what you intended?

This already looks great. Are you interested in helping prevent such errors in the future? You saw how easy it is to add a test case. They will be used for in-build tests checking that formulas are  calculated correctly.

If you send the file to libreoffice-qa@lists.freedesktop.org with the license notice so that I can use it in an in-build test. You will be named as author of the commit.

Thanks for your help. Fix will be in 3.6 and maybe in 3.5.4
Comment 6 Not Assigned 2012-05-06 20:34:22 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c0ca1ef1990226cd5d7af6c1f76872e9ad8711f2

string result of formula is also valid, fdo#49052
Comment 7 Not Assigned 2012-05-07 12:53:15 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=864fc92a5644ea56cd0fd3dec4e40601b828b31c&g=libreoffice-3-5

string result of formula is also valid, fdo#49052


It will be available in LibreOffice 3.5.4.
Comment 8 Korrawit Pruegsanusak 2012-05-12 00:41:23 UTC
marc.claes9, thanks for your bug report. :)

Anyway, it seems that the mail containing database.ods test file with the license notice doesn't yet reach the mailing list. Is this our server-side problem, or my bad that I didn't see your mail, or you forgot to send it, or you don't want to send it, or ... ? ;)

In any case, please feel free to tell. Of course we appreciate your contributions. Thanks again for making LibreOffice better and better :)
Comment 9 Xisco Faulí 2021-09-16 10:02:55 UTC
The fixed for this issue is covered by https://cgit.freedesktop.org/libreoffice/core/commit/?id=fe17fd2aa662b7b535af3a7063d90c849d712cbb