# Counting a row only if it's a child row and has been modified in the last 30 days

edited 11/18/21

I'm trying to create a formula to only count rows that are child rows (was trying to do this using the Counter row being <1) and have been modified in the last 30 days. I was able to get the modified in the last 30 days part to work on its own, but can't get them to work together. Here's where I'm at now - any suggestions?

=COUNTIFS((Counter2:Counter984, <1), ((Modified1:Modified985, AND (@cell <= Today(), @cell > Today(-30)))

• ✭✭✭✭✭✭

Hey @RyanWithem

Your ranges are different lengths. These need to be the same. If you don't need to designate row numbers, leave them off and your range will grow as your column length grows. You also had parentheses out of place.

Try this

=COUNTIFS(Counter2:Counter984, <1,Modified2:Modified984, AND (@cell <= Today(), @cell > Today(-30)))

cheers

• ✭✭✭✭✭✭

Hey @RyanWithem

Your ranges are different lengths. These need to be the same. If you don't need to designate row numbers, leave them off and your range will grow as your column length grows. You also had parentheses out of place.

Try this

=COUNTIFS(Counter2:Counter984, <1,Modified2:Modified984, AND (@cell <= Today(), @cell > Today(-30)))

cheers

• Awesome, great tip @Kelly Moore, thank you!

I got it to work using:

=COUNTIFS(Counter:Counter, ISBLANK(@cell), Modified:Modified, AND(@cell <= TODAY(), @cell > TODAY(-30)))

Good call on leaving row numbers off as well - I hadn't thought about that. Appreciate it!

• ✭✭✭✭✭✭

Excellent! Happy to help. I'm glad you got it working

Kelly

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!