Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to SUMIF with two conditions in Google Spreadsheet

I need to sum the values from different sheets with two conditions.

The sample layout as following, I'd like to sum the values when Name=Andy,and Type=XXX ; add 35+43+23+35+18

Name      Type      Value
Andy       XXX       35
Bill       XXX       27
Gino       XXX       48
Bill       YYY       35
Andy       XXX       43
Bill       ZZZ       67
Gino       XXX       58
Bill       YYY       25
Andy       XXX       23
Andy       XXX       35
Bill       YYY       17
Gino       XXX       44
Bill       YYY       51
Andy       XXX       18
Bill       ZZZ       73

Please help with the formula. Truly appreciate!!

like image 873
user3654819 Avatar asked Feb 13 '23 22:02

user3654819


1 Answers

Definition of SUMIFS() is as follow:

SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...])

Therefore, the formula you want is:

SUMIFS(C2:C20, A2:A20, "Andy", B2:B20, "XXX")

Reference: SUMIFS()

like image 82
Raptor Avatar answered Feb 15 '23 20:02

Raptor