SOLVED

# Sumif or Sumifs help

Highlighted
Occasional Contributor

# Sumif or Sumifs help

I want to count and add the value in cell B:B if cell A:A is red and D:D is today

 red 25 8/9/2019 blue 27 red 65 9/9/2019 total red 90 8/9/2019 25 blue 27 8/9/2010 0

8 Replies
Highlighted
Solution

# Re: If or count if help

=SUMIF(A:A,"red",B:B) sums all cells in column B where column A equals "red".
Highlighted

# Re: If or count if help

=SUMIFS(B1:B3,A1:A3,"red") should work for you.

Highlighted

# Re: If or count if help

Thank you, it say array are different size.
Highlighted

# Re: If or count if help

Thank you it say array are different size.
Highlighted

# Re: If or count if help

All arguments in the function must point to the same number of rows.
Highlighted

# Re: If or count if help

@Jan Karel Pieterse yey, i got it. Thank you so much

Highlighted

# Re: If or count if help

what if i want to add another condition if cell C:C is equal to green?
Highlighted

# Re: If or count if help

That would mean adding the condition to the formula:
=SUMIFS(B1:B3,A1:A3,"red",C1:C3,"green")
Note that BOTH conditions must be met, if you want to sum them if either condition is met:
=SUMIFS(B1:B3,A1:A3,"red")+SUMIFS(B1:B3,C1:C3,"green")