When I use this query in Google sheets
=QUERY('Kontoutdrag länsförsäkringar'!$A$3:$F$1000186;"SELECT sum(F) WHERE B >= date'" & TEXT(DATEVALUE(J$4);"yyyy-mm-dd") & "' AND B <= date '"& TEXT(DATEVALUE(J$5);"yyyy-mm-dd") &"' AND D matches '" & JOIN("|";$T10:$CZ10) &"' AND D != '' label sum(F)'' ")
It will skip any cell that contains an asterisk somewhere in the text, the character
*
The error is in this match part
AND D matches '" & JOIN("|";$T10:$CZ10)
If the D column's text (and the corresponding, identical cell in the join range) contains an asterisk it will not match.
Is there a way to escape this so that I can have cells with the asterisk in the text?
This value will work
K Batteriexp
This value will not be picked up by the query
K*Batteriexp
If asterisk is the only problem, You can escape it using regex:
This
becomes