You
You

Reputation: 1

Google sheets Sumifs multiple criterias

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

Answers (1)

player0
player0

Reputation: 1

try:

=SUM(FILTER(C2:2, REGEXMATCH(C1:1, "(?:)fri|sat|sun")))

enter image description here

or:

=SUMPRODUCT(C2:2, REGEXMATCH(C1:1, "(?:)fri|sat|sun"))

enter image description here

Upvotes: 0

Related Questions