# Count if distinct and if meets set criteria

Options

I am trying to count unique rows if certain information is met.

For example, one of the formulas I have written is =COUNTIFS({PledgeAmountSummary2022 Range 1}, Campaign@row, {PledgeAmountSummary2022 Range 4}, Division@row). This works until I try to add the stipulation of only counting unique data based on another column within the same reference sheet.

Can someone help me set this formula up correctly? I have tried a number of times and a number of ways and keep getting errors.

• ✭✭✭✭✭✭
Options

This formula counts unique dates in the column Schedule date that meet the condition of being older (les than) today. (change the row numbers to @row to expand it)

=COUNT(DISTINCT(COLLECT([Schedule date]39:[Schedule date]47, [Schedule date]39:[Schedule date]47, <TODAY())))

You should be able to use those functions within your formula.

dm

• ✭✭✭✭✭✭
Options

This formula counts unique dates in the column Schedule date that meet the condition of being older (les than) today. (change the row numbers to @row to expand it)

=COUNT(DISTINCT(COLLECT([Schedule date]39:[Schedule date]47, [Schedule date]39:[Schedule date]47, <TODAY())))

You should be able to use those functions within your formula.

dm

• Options

@Dale Murphy, Thank you but I am not looking at a date. I am trying to count the number of unique donations for each location and each campaign that we have.

• ✭✭✭✭✭✭
Options

The principle should apply. Instead of doing a distinct collect on date, use whatever is unique about the donation row. (Is there an id or registration number of some kind?)

dm

• Options

That worked! Thank you @Dale Murphy

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!