# Sumif using several columns

#### uk747

##### Well-known Member
trying to add columns using a sumif

The names I'm using are in columns A, H and and J and the figures in B, F and K

Tried the formula belw but wouldnt work, said too many arguments

(A1:A30,E1:E30,H1:H30,J1:J30,"Dog",B1:B30,F1:F30,I1:I30,K1:K30) and tried named ranges =SUMIF(animal,"dog",age) and get value #

### Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

#### FormR

##### MrExcel MVP
I think you would get a better response if you could show an example of your data and the expected results.

#### s hal

##### Board Regular
SUMIF() only accepts ONE codition and ONE range to check and ONE range to sum - you fed it too many conditions, which is why you got an error.

SUMIFS() is maybe what you want to use (if you are in 2007 or later version). Or the more advanced, SUM(IF()) if you are not.

I can't answer why your named range method didn't work, but I'd speculate for the same reason the first SUMIF() example did not.

#### uk747

##### Well-known Member
I think you would get a better response if you could show an example of your data and the expected results.

Table below is in 3 different columns and it needs to add up the age every time dog appears

 ANIMAL Age dog 5 cat 3 rabbit 2 dog 4 canary 3 parrot 2 snake 1

<tbody>
</tbody>

#### uk747

##### Well-known Member
unfortunately only have 2003, but out of curiosity how would the formula appear in 2007 using sumifs

#### s hal

##### Board Regular
You just need to have 3 SUMIF() functions: SUMIF()+SUMIF()+SUMIF(). There's probably a more complicated way to do this as well, but I'd stick with the basics...

#### FormR

##### MrExcel MVP
One option:
Excel Workbook
ABCDEFGHIJ
1ANIMALAgeANIMALAgeANIMALAgeSum
2dog5dog5dog527
3cat3cat3cat3
4rabbit2rabbit2rabbit2
5dog4dog4dog4
6canary3canary3canary3
7parrot2parrot2parrot2
8snake1snake1snake1
Create or Edit a Quote

#### uk747

##### Well-known Member
thanks guys I'll use the 3 sumifs adding them together, you both suggested

Replies
3
Views
1K
Replies
8
Views
313
Replies
6
Views
192
Replies
1
Views
594
Replies
2
Views
237

1,195,853
Messages
6,011,969
Members
441,658
Latest member
Carlos O

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back