Bug 95659 - SUMIF does not sum properly if criteria cell contain PLUS symbol (+) within text
Summary: SUMIF does not sum properly if criteria cell contain PLUS symbol (+) within text
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-07 17:13 UTC by Mark Yoseph
Modified: 2015-11-07 17:56 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 Mark Yoseph 2015-11-07 17:13:22 UTC
I created a column, filled it with Product Name list, and then tried to use SUMIF to sum any cell that matched with Product Name.

Some of it didn't work, so I checked the cell Text. If it contains plus sign (+), it won't work, for example:
*) Video+Power
*) Video + Power

But any other symbol, such as (&) or (-) works. To reproduce:
- Fill A1 with any text containing plus sign(+), such as: Video+Power
- Fill A2 to A3 with any text without any plus sign(+), such as: Video-Power
- Fill B1 to B3 with any number
- Fill C1 with this formula: =SUMIF(A1:A3;A1;B1:B3)

The SUMIF result will be 0. If you use SUMIF without any plus sign(+), it will return the true result.
Comment 1 m_a_riosv 2015-11-07 17:56:53 UTC
Hi @Mark, thanks for reporting.

SUMIF uses regular expression (like extended wildcards), but more powerful.
https://help.libreoffice.org/3.3/Common/List_of_Regular_Expressions

+ is part of them.


Two solutions;

· Disable regular expressions in Menu/Tools/Options/LibreOffice calc/Calculation - Regular expression.

· Escaape the plus for search with a backslash \+ if you want to use regex.

One trick, is involve the text to search with SUBSTITUTE function to replace in the text to search the + with a \+, if you wan to use regex.

If you are not agree or is a different issue, please reopen the bug.