# SUMIF or SUMIFS (multiple columns and YEAR and MONTH criteria)

✭✭✭✭
edited 06/17/22

Formula Logic (for the formula that would be a column formula for the Jan column - needs to be a single formula):

SUM ([Received Count] if [Date Recd]'s YEAR = 2022 AND MONTH = 1) and also SUM ([Completed Count] if [DateCompleted]'s YEAR = 2022 AND MONTH = 1)

Thank you!

Tags:

• ✭✭✭✭✭✭

My apologies. I misunderstood exactly what you were trying to do.

=IF(AND(YEAR([Date Recd]@row), MONTH([Date Recd]@row) = 1), [Received Count]@row) + IF(AND(YEAR(DateCompleted@row), MONTH(DateCompleted@row) = 1), [Completed Count]@row)

• ✭✭✭✭✭✭

You would use two separate SUMIFS (one for the Received Count and one for the Completed Count) and then add them together.

=SUMIFS(.............) + SUMIFS(...............)

• ✭✭✭✭

Thank you! Getting an incorrect argument set error with this formula I tried:

=SUMIFS([Received Count]@row, [Date Recd]@row, YEAR([Date Recd]@row) = 2022, MONTH([Date Recd]@row) = 1) + SUMIFS([Completed Count]@row, DateCompleted@row, YEAR(DateCompleted@row) = 2022, MONTH(DateCompleted@row) = 1)

• ✭✭✭✭✭✭
edited 06/20/22

When you have multiple criteria sets for the same range, you need to wrap them in an AND function like so:

{Range}, AND(criteria_1, criteria_2)

• ✭✭✭✭

=SUMIFS([Received Count]@row, [Date Recd]@row, AND(YEAR([Date Recd]@row) = 2022, MONTH([Date Recd]@row) = 1)) + SUMIFS([Completed Count]@row, DateCompleted@row, AND(YEAR(DateCompleted@row) = 2022, MONTH(DateCompleted@row) = 1))

Formula above doesn't error out anymore, but it's not adding the .5 credits. When Date Received's year = 2022 and Date Received's Month = 1, it should add .5 to the Jan column. When DateCompleted's year = 2022 and DateCompleted's Month = 1, it should add another .5 to the Jan column. So for the Jan column cells above, they should either be .5 or 1 (depending on if Date Recd and DateCompleted are both January 2022 or if only one of them is)

Thank you so much!

• ✭✭✭✭✭✭

My apologies. I misunderstood exactly what you were trying to do.

=IF(AND(YEAR([Date Recd]@row), MONTH([Date Recd]@row) = 1), [Received Count]@row) + IF(AND(YEAR(DateCompleted@row), MONTH(DateCompleted@row) = 1), [Completed Count]@row)

• ✭✭✭✭

Added = 2022 after the YEAR sections and it worked! Thank you so much!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!