https://bugs.documentfoundation.org/show_bug.cgi?id=167171

            Bug ID: 167171
           Summary: MATCH function ignores the last value in an inline
                    array
           Product: LibreOffice
           Version: 24.8.0.0 alpha1+
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
MATCH function ignores the last value in an inline array.

Steps to Reproduce:
1. Open new Calc.
2. Insert formula "=MATCH(2; {1,2}; 1)" to Cell [A1].

Actual Results:
3. Result is 1.
   This is an incorrect value.

Expected Results:
3. Result is 2.


Reproducible: Always


User Profile Reset: No

Additional Info:

This bug does not depend on the direction of the inline array.

If the argument specifies an exact match, "= MATCH (2; {1,2}; 0)" returns the
correct value "2".

For example, adding the values of an inline array to "= MATCH (2; {1,2,3}; 1)"
gives the correct answer "2".
However, if you change the first argument to "3" and change the formula to "=
MATCH (3; {1,2,3}; 1)", the result is still "2" and does not return the correct
answer "3".

And similarly for descending order, "= MATCH (1,  {2,1}, -1)" returns "1", but
should return "2".

Also, each of the extreme examples of this bug rule

=MATCH(1;{1};1)
=MATCH(1;{1};0)
=MATCH(1;{1};-1)

returns

#N/A
1
#N/A

, but they should all return "1".

The following formulas all return the wrong value "1" in Version 24.8.0.0.
alpha1 and later, but all return the correct answer "2" in Google Spreadsheet
and MS Excel Web Version.

=MATCH(2; {1,2}; 1)
=MATCH(1; {2,1}; -1)
=MATCH("2"; {"1","2"}; 1)
=MATCH("1"; {"2","1"}; -1)

---
These formulas worked correctly until version: 24.2.7.2.

Not reproduced with
Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: default

---
Reproducible with
Version: 24.8.0.0.alpha1 (X86_64) / LibreOffice Community
Build ID: a17e39caaf73108bee692d6f64a44c62f4066f1d
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render:
Skia/Vulkan; VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: CL threaded

Reproducible with
[2025-06-20]
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 024053c0c140e1d167a0276f1885a21a160b45ac
CPU threads: 4; OS: Windows 10 X86_64 (build 19045); UI render: Skia/Raster;
VCL: win
Locale: en-US (ja_JP); UI: en-US
Calc: CL threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to