Bug 167468 - XMATCH with mode=0 and searchdirection=-1 returns #N/A where 1 should be expected
Summary: XMATCH with mode=0 and searchdirection=-1 returns #N/A where 1 should be expe...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.2.4.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2025-07-11 16:03 UTC by Wolfgang Jäger
Modified: 2025-07-13 08:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
demonstrating the bug (14.61 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-07-11 16:03 UTC, Wolfgang Jäger
Details
corrected loop (1.09 KB, patch)
2025-07-12 00:47 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jäger 2025-07-11 16:03:38 UTC
Created attachment 201759 [details]
demonstrating the bug

Also present in 25.8.0.0.beta1
The summary says it all.
XMATCH with mode=0 and searchdirection=-1 returns #N/A where 1 should be expected
Comment 1 Werner Tietz 2025-07-11 17:02:07 UTC
Confirmed!

@Wolfgang:
another workaround:
=XMATCH("\d+";B2:E2;3;-1)
Comment 2 m_a_riosv 2025-07-11 22:02:36 UTC
Reproducible:
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7ef1c437f30b0869a5b9fa33809bac2c6665ace3
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: en-US (es_ES); UI: en-US
Calc: CL threaded

The file, saved as xlsx after set up the use of wildcards, none of the formulas work with:
Microsoft® Excel® para Microsoft 365 MSO (versión 2506 compilación 16.0.18925.20076) de 64 bits
Comment 3 Regina Henschel 2025-07-12 00:47:07 UTC
Created attachment 201763 [details]
corrected loop

Off-by-one error. BTW, changing i>0 to i>=0 will not work because SCSIZE is unsigned integer.
Comment 4 Óvári 2025-07-13 08:48:03 UTC
Balázs can you please have a look? Thank you