How to use WildCard as part of SUMIFS

I’m trying to calculate the totals based upon three categories, which may or may not all be filled. In excel I can just place an asterisk in the blank Categories as per the DATA section below. But it doesn’t seem to work in LO, any ideas what I can do?

SUMMARY
The following starts at A5

CAT A | CAT B | CAT C |
6 > HOUSEHOLD | UTILITIES | ELECTRIC |  =SUMIFS($P$6:$P$22,$M$6:$M$22,A6,$N$6:$N$22,B6,$O$6:$O$22,C6)
7 > HOUSEHOLD | UTILITIES | GAS |
8 > HOUSEHOLD | GROCERIES |           |

DATA
The following starts at M5

CAT A | CAT B | CAT C | VALUE
6 > HOUSEHOLD | UTILITIES | ELECTRIC |  50
7 > HOUSEHOLD | UTILITIES | GAS | 35
8 > HOUSEHOLD | GROCERIES |*| 18
9 > HOUSEHOLD | GROCERIES |*| 10

Both LibreOffice 6.2.4.2 and MS Excel 2016 give 50 for the mentioned data, which I assembled as wildcard.xlsx.