# How to apply a priority countif formula to specific rows based on cell criteria?

Options

Hello,

I am using the following formula in a priority column to maintain ranking number when filtering my sheet. I would like to apply this formula to the rows based on criteria in my "Open, Backlog, Closed" column. For instance, if a closed is selected for a row, i do not want the formula to apply to that row.

=COUNTIFS([Project Name]\$1:[Project Name]@row, OR(@cell = "", @cell <> ""))

Any help would be appreciated.

Tags:

• ✭✭✭✭✭✭
Options

Check if this meets your requirement,

=IF([Status Column Name]@row <> "Closed",
COUNTIFS([Status Column Name]\$1:[Status Column Name]@row, <>"Closed",
[Project Name]\$1:[Project Name]@row, OR(@cell = "", @cell <> "")
)
)

• ✭✭✭✭✭✭
Options

Do you mean to say that for anything other than "Closed" apply the formula? If yes, then you can write it this way,

=IF(HAS([Status Column Name Here]@row, "Closed"), "", COUNTIFS([Project Name]\$1:[Project Name]@row, OR(@cell = "", @cell <> "")))

• Options

Hi @Sameer Karkhanis - that's exactly what I am aiming to do - and thank you for this. This formula get's me closer. IT does not number the rows with a closed status, but numbers the other rows as if the closed rows are not being skipped.

Thoughts?

• ✭✭✭✭✭✭
Options

Check if this meets your requirement,

=IF([Status Column Name]@row <> "Closed",
COUNTIFS([Status Column Name]\$1:[Status Column Name]@row, <>"Closed",
[Project Name]\$1:[Project Name]@row, OR(@cell = "", @cell <> "")
)
)

• Options

It works! Thanks so much for your time. Big help.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!