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!
Best Answer
-
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
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Answers
-
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.
Holly Conrad Smith
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), "")
Holly Conrad Smith
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
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
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
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!