How to SUMIF that tests if length of cell is 1

Consider the following:

What is the formula that “sums column C if the length of the corresponding cell in column A is =1” ?

Hallo

Solution with the Swiss-Army-Knife in terms of functions:
=SUMPRODUCT(LEN(A1:A4)=1, C1:C4)

Yes. Much better imo.

Agree. This may be also faster.

Aha! I agree, this was what I was looking for! Thanks :slight_smile:

If you use wildcards in formulas (default for recent LO versions), then you may use "=?" as criteria. If you use regular expressions, your criteria will be "=.". See ToolsOptionsLibreOffice CalcCalculate for settings that control using regexes/wildcards in formulas.

I have wildcards on. Not sure how to write it. Do you mean =SUMIF(A1:A4,LEN(=?)=1,C1:C4) ? This formula doesn’t work.

=SUMIF(A1:A4,"=?",C1:C4)

Note that "=?" depends on the Tools-Options-Calc-Calculate setting “Search criteria = and <> must apply to whole cells”, if that is disabled the search matches any cell content of at least one character, not just one character.

The = inside the criteria-expression is optional both (wildcard|regEx) works without it.
anyway I would prefer a solution without dependencies of weird settings…see my Answer