# SUMIF with two conditions and a checkbox

Hi Everyone,

I'm currently trying to come up with a formula using sumif (or sumifs) with multiple conditions. I'm trying to sum the item value of every row in my sheet ONLY IF the patient ID of the rows is the same AND "Fiscal Year 2022" is checked. Currently I'm trying the formula: =SUMIF([Fiscal Year 2022?]@row, 1, [Patient ID]:[Patient ID], [Patient ID]@row, [Item Value]:[Item Value]) with no success.

*There is no identifying info in the attached screenshot!*

Thanks so much!

• ✭✭✭✭✭✭

In Holly's first formula, the range for the checkbox value is set to a single row instead of the whole range. Mismatched ranges in a formula will cause the incorrect argument error. Try this one instead:

=SUMIFS([Item Value]:[Item Value], [Fiscal Year 2022?]:[Fiscal Year 2022?], 1, [Patient ID]:[Patient ID], [Patient ID]@row)

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

• ✭✭✭✭

Hi @emma.blake,

You would need to use SUMIFS if there are multiple criteria.

=SUMIFS([Item Value]:[Item Value], [Fiscal Year 2022?]@row, 1, [Patient ID]:[Patient ID], [Patient ID]@row)

The syntax of sumifs is slightly different than sumif. The range you wish to sum must go first.

Director of Technology & Innovation 💡 at Streamline

CliftonStrengths Top 5: Deliberative, Restorative, Achiever, Consistency, Harmony

• Thank you for your response! I tried this formula, but it returned "Incorrect Argument". Any other suggestions?

Thanks again!

• ✭✭✭✭

Try

=if([Fiscal Year 2022?]@row=1, SUMIFS([Item Value]:[Item Value], [Fiscal Year 2022?]@row, 1, [Patient ID]:[Patient ID], [Patient ID]@row), "")

Director of Technology & Innovation 💡 at Streamline

CliftonStrengths Top 5: Deliberative, Restorative, Achiever, Consistency, Harmony

• ✭✭✭✭✭✭

In Holly's first formula, the range for the checkbox value is set to a single row instead of the whole range. Mismatched ranges in a formula will cause the incorrect argument error. Try this one instead:

=SUMIFS([Item Value]:[Item Value], [Fiscal Year 2022?]:[Fiscal Year 2022?], 1, [Patient ID]:[Patient ID], [Patient ID]@row)

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

• @Jeff Reisman Thank you so much!! This worked perfectly

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!