# Help with IF/ Then Formula Based on Number of Rows

Options
✭✭

Hey Guys,

I want to create a formula that will return a statement when a number of certain number of rows is reached.

I have a unique cell that has a number let's say 10, and I created a helper column (Row ID) that will simply designate each row by a number. I want to create an automatic statement in another cell that will alert a customer when they create 10 rows.

I tried creating my own IF formula but It's not working.

Can someone guide me with the correct formula?

Tags:

• ✭✭✭✭✭✭
Options

Yes. You would use a basic subtraction where you subtract the MAX from the set number.

=[Cell Reference For Limit]row# - MAX([Row ID]:[Row ID])

• ✭✭✭✭✭✭
Options

You would use somethign like this:

=IF(MAX([Row ID]:[Row ID]) >= [Cell Reference For Limit]row#, "output when true")

• ✭✭
Options

This worked beautifully! Thank you, Paul :)

• ✭✭
Options

The above equation worked smoothly, but it made me wonder if it would also be possible to create a formula that would calculate the number of rows remaining for the client to use the smart sheet

Example: 10 rows maximum

as the user inputs 1 row, the formula would calculate a number as 9

two rows total, then 8.

Would something like that also be possible?

• ✭✭✭✭✭✭
Options

Yes. You would use a basic subtraction where you subtract the MAX from the set number.

=[Cell Reference For Limit]row# - MAX([Row ID]:[Row ID])

• ✭✭
Options

Much appreciated, Paul!

• ✭✭✭✭✭✭
Options

Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!