Reputation: 1
So I was to calculate the Weekend data from this chart enter image description here, by the following 2 formulas.
Formula A
=SUMIFS($C2:2,$C$1:$1,{"Fri","Sat","Sun"})
Result:
Only the data for Friday.
Formula B
=SUMIFS($C2:$2,$C$1:$1,"Fri")+SUMIFS($C2:$2,$C$1:$1,"Sat")+SUMIFS($C2:$2,$C$1:$1,"Sun")
Result: Works properly.
So my question is that, the formula A works correctly in EXCEL, how should I change and make it work in GOOGLE SHEET as well?
Upvotes: 0
Views: 30
Reputation: 1
try:
=SUM(FILTER(C2:2, REGEXMATCH(C1:1, "(?:)fri|sat|sun")))
or:
=SUMPRODUCT(C2:2, REGEXMATCH(C1:1, "(?:)fri|sat|sun"))
Upvotes: 0