# Sumif query

#### CVN55

##### New Member
Hi - what is wrong with this formula? I have used it successfully with sumproduct?
=SUMIF(H8:H106,--(\$B\$8:\$B\$106="CARU")--(\$D\$8:\$D\$106="Medical"))
Trying to add a column which contains the words CARU in one column and Medical in another...

Thank you,
Catherine

### Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

#### Weazel

##### Well-known Member
you would need to use sumifs as you are looking for multiple conditions, as well as the syntax for sumif/sumifs is much different than sumproduct...

=SUMIFS(H8:H106,\$B\$8:\$B\$106,"CARU",\$D\$8:\$D\$106,"Medical")

#### Joe4

Your SUMIF formula is structured completely wrong. It looks like your wrote a SUMPRODUCT formula, and just swapped out the SUMPRODUCT for SUMIF.
SUMIF also only allows one conditions. SUMIFS allows more than one.
See: https://exceljet.net/excel-functions/excel-sumifs-function

So your formula should either be:
=SUMPRODUCT(H8:H106,--(\$B\$8:\$B\$106="CARU")--(\$D\$8:\$D\$106="Medical"))

or
=SUMIFS(H8:H106,B8:B106,"CARU",D8:D106,"Medical")

Last edited:

#### edmitchell

##### New Member
Catherine

=SUMIFS(H8:H106,\$B\$8:\$B\$106,"CARU",\$D\$8:\$D\$106,"Medical")

hope that works!

Ed

Replies
4
Views
73
Replies
6
Views
80
Replies
2
Views
108
Replies
6
Views
58
Replies
5
Views
85