# SUMIFS for prior month

I've been trying to figure this one out for a while and cannot get it to work. We want to have a count of how many RFPs meet criteria for the prior month (without having to filter on a report every time). Is this possible? Here's what I have for the simplest one, but it is not giving me the correct number:

• See below:

=COUNTIFS(Source:Source, CONTAINS("GSD", @cell), [Date Received]:[Date Received], OR(AND(IFERROR(MONTH(@cell), 99) = (MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = YEAR(TODAY())), AND(IFERROR(MONTH(@cell), 99) = (MONTH(TODAY()) + 11), IFERROR(YEAR(@cell), 0) = (YEAR(TODAY()) - 1))))

• Try the below:

=COUNTIFS(Source:Source, CONTAINS("GSD", @cell), [Date Received]:[Date Received], OR(IFERROR(MONTH(@cell), 99) = (MONTH(TODAY()) - 1), IFERROR(MONTH(@cell), 99) = (MONTH(TODAY()) + 11)))

• That returns too high a number.

• Is this a list that goes back more then 12 months?

The formula above does not take into account the year... Do you need that?

• @Leibel S - yes it does so I guess I do need to add the year. Thank you!

• See below:

=COUNTIFS(Source:Source, CONTAINS("GSD", @cell), [Date Received]:[Date Received], OR(AND(IFERROR(MONTH(@cell), 99) = (MONTH(TODAY()) - 1), IFERROR(YEAR(@cell), 0) = YEAR(TODAY())), AND(IFERROR(MONTH(@cell), 99) = (MONTH(TODAY()) + 11), IFERROR(YEAR(@cell), 0) = (YEAR(TODAY()) - 1))))

• That worked! Thank you so much.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!