# SUMIF Formula Not Working

#### BlueRhinos

##### Board Regular
I have written a Sumif Formula for the purpose of adding cells within a range that meet multiple criteria. The formula syntax was copied from a MR Excel forum and the parameters were updated in accord with my spreadsheet. The resulting value is 0 as opposed to #NA, which indicates the formula syntax is correct?? I can accomplish my desired result by creating multiple counif formulas and summing them up, but wanted to streamline the process. Why is this formula performing the math?

### Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

#### Norie

##### Well-known Member
Can you post the formula?

Also some sample data and expected result(s) might be useful.

#### Seti

##### Well-known Member
Welcome to the forum. Can you hare your formula so we can look at it?

#### Scott Huish

##### MrExcel MVP
A value of 0 versus #N/A does not necessarily mean the syntax is correct.

#### BlueRhinos

##### Board Regular

Thanks for the welcome! I just discovered I can do what I need to with only a sum formula!! However, I'd still like to learn about SUMIF. Here's a high level summary of what I'm trying to...I have a column of data that contains associates names followed by a specific number of courses taken.
John
4
Jim
3
Dave
2....
I was trying to add up all the numeric data with a sumif (not realizing that excel would ignore the text data when using just a sum formula.).

Here's the formula I was using that produced a 0.

=SUM(IF(\$E\$2:\$E\$2001=1,IF(\$E\$2:\$E\$2001=2,1,0),0))

#### barry houdini

##### MrExcel MVP
That formula will count cells in the range that equal 1.....and equal 2. Of course no cell can equal both 1 and 2 at the same time so the formula will always return 0.

If you actually wanted to count cells that equal 1 or 2 then you could use

=SUM(COUNTIF(\$E\$2:\$E\$2001,{1,2}))

...but I don't suppose you really want to do that......

#### BlueRhinos

##### Board Regular

Thanks for your help Barry. Any idae how to quickly upload an image to replace the flag icon?

#### barry houdini

##### MrExcel MVP
click on "profile" at the top of the page. You should be able to upload an avatar and/or change the flag

#### NateO

##### Legend
Welcome to our Forums.

Note, flags and avatars are two different deals, the Avatar Control Pannel is located at the very bottom of your profile settings.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,424
Messages
5,837,155
Members
430,479
Latest member
mamush200

### 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