May I suggest the following:
In the "IFSUM Attempt.ods" the formula was "=SUMIF(A1:H8,"*Shopping*",H1:H8)" which gave ERR:508
As noted above this incorrectly uses "," separating the arguments instead of ";". This alone would give ERR:508
In addition the comparison is against "*Shopping*".
The addition of a full stop before each "*" is required to make the criteria text meet the regular expression rules in Open Office.
For this to work you have to select "Enable regular expressions in formula" in the menu item Tools -> Options -> OpenOffice Calc ->Calculate
This gives the correct formula "=SUMIF(A1:H8;".*Shopping.*",H1:H8)"
i.e. match against "Shopping" anywhere within a cell.
In the example given "Shopping" is at the start of the text so "=SUMIF(A1:H8;"Shopping.*",H1:H8) would also work.
SamIfTrue reported that his formula worked in google sheets. I presume because sheets is based on EXCEL which also uses the argument separator ","
Also perhaps sheets does not require the initial "." (any character) before "*" (zero or more) as required by the regular expression rules in Open Office
While the option of de-selecting "Search Criteria = and <> Must Apply To Whole Cells" in the menu item Tools -> Options -> OpenOffice Calc -> Calculate
does work in the given solution, it might introduce other problems where you only wanted a formula to match the whole value of a cell.
In fact de-selecting this option would match "Shopping" anywhere in a cell, for example "Not in Shopping"!
Mind you it would not match "Not in shopping" if "Case-sensitive" was selected in the menu item Tools -> Options -> OpenOffice Calc -> Calculate
Curiously in SUMIF and some other functions regular expression matching is Case-INsensitive
So the above regular expression "=SUMIF(A1:H8;".*Shopping.*",H1:H8)" would also match "Not in shopping", though of course
"=SUMIF(A1:H8;"Shopping.*",H1:H8)" would not ("Shopping..." only at start of text)
This is why I recommend using regular expressions as this enables precise matching of text patterns.
In the "IFSUM Attempt.ods" the formula was "=SUMIF(A1:H8,"*Shopping*",H1:H8)" which gave ERR:508
As noted above this incorrectly uses "," separating the arguments instead of ";". This alone would give ERR:508
In addition the comparison is against "*Shopping*".
The addition of a full stop before each "*" is required to make the criteria text meet the regular expression rules in Open Office.
For this to work you have to select "Enable regular expressions in formula" in the menu item Tools -> Options -> OpenOffice Calc ->Calculate
This gives the correct formula "=SUMIF(A1:H8;".*Shopping.*",H1:H8)"
i.e. match against "Shopping" anywhere within a cell.
In the example given "Shopping" is at the start of the text so "=SUMIF(A1:H8;"Shopping.*",H1:H8) would also work.
SamIfTrue reported that his formula worked in google sheets. I presume because sheets is based on EXCEL which also uses the argument separator ","
Also perhaps sheets does not require the initial "." (any character) before "*" (zero or more) as required by the regular expression rules in Open Office
While the option of de-selecting "Search Criteria = and <> Must Apply To Whole Cells" in the menu item Tools -> Options -> OpenOffice Calc -> Calculate
does work in the given solution, it might introduce other problems where you only wanted a formula to match the whole value of a cell.
In fact de-selecting this option would match "Shopping" anywhere in a cell, for example "Not in Shopping"!
Mind you it would not match "Not in shopping" if "Case-sensitive" was selected in the menu item Tools -> Options -> OpenOffice Calc -> Calculate
Curiously in SUMIF and some other functions regular expression matching is Case-INsensitive
So the above regular expression "=SUMIF(A1:H8;".*Shopping.*",H1:H8)" would also match "Not in shopping", though of course
"=SUMIF(A1:H8;"Shopping.*",H1:H8)" would not ("Shopping..." only at start of text)
This is why I recommend using regular expressions as this enables precise matching of text patterns.
Statistics: Posted by Phillip — Mon Jul 29, 2024 9:06 pm