Bug 61990 - Enhancement request: Support Excel wildcards in database/sumif criteria via preference
Summary: Enhancement request: Support Excel wildcards in database/sumif criteria via p...
Status: RESOLVED DUPLICATE of bug 38125
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-07 22:35 UTC by Tim Richardson
Modified: 2013-03-07 23:50 UTC (History)
1 user (show)

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 Tim Richardson 2013-03-07 22:35:20 UTC
The document standards define two styles of wildcard in criteria. LO supports regex, but not the Excel "wildcard" version. The Excel version is a simple subset of REs (but with conflicting syntax). 
The consequence is that there can be huge differences in the result of a formula using an Excel-style wildcard.

For example, 
=sumif(A1:A10,"paypal*",B1:B10)
in Excel 
will match any cell with the string paypal

This formula imports literally into LibreOffice. If regular expressions are turned on, the criteria is interpreted as a RE. However, what the Excel wildcard really means is "paypal.*" 


Further, Excel uses ? to stand for one character and it uses ~ as the escape character.

The criteria are used in the "database" family of functions (and sumif)

My request is that there be an preference "use Excel-style wildcards" and that this be enabled by default for spreadsheets in Excel format.

I think this would close some potentially subtle but huge incompatibilities.
Comment 1 m_a_riosv 2013-03-07 23:50:40 UTC
Hi Tim,
I think more than a bug is a request for enhancement.
And a duplicate of the bug https://bugs.freedesktop.org/show_bug.cgi?id=38125

One trick to deal with the issue, instead of directly using the wildcards, have a couple of named cell with the wildcards and change there.
e.g cell named "All" with ".*" or "*", and "One" with "." or "?".
in the formulas:
=sumif(A1:A10,"paypal"&All,B1:B10)

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