Limit number of times data can be used in a row

neetal

New Member
Joined
Apr 17, 2014
Messages
4
Hello all,

I am using Windows XP (soon to be switched to Windows 7), and I'm creating a scheduling form in Excel. I would like to limit the number of times users can put the letter "r" into a row (which defines the dates in the Payperiod. The limit is 8. I tried to come up with a way to use validation, but that didn't work. I'm not certain if this would be a formula or VBA code.

Thank you in advance for your help.

neetal
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Thank you so much for your help with this! I think I might be doing it incorrectly though. I highlighted all the cells for the row, then put in the validation rule as mentioned above, but it didn't stop me from adding more than 8 rs and i didn't get a "Stop" sign though I did add that in. Should I be using validation in a different place?

Again, thank you SO much for your gift of time with this.
 
Upvote 0
Change the formula to =COUNTIF($B$2:B2,"r")<9 and enter it as you did. My apologies on the error in the formula
 
Upvote 0
The above will check them as they are entered left to right. If they might be entered in some other order use the range $B$2:$AD$2.
 
Upvote 0
This one worked PERFECTLY!!! In fact they will be probably entered in random ways, but this definitely put a stop after 8 entries. Thank you again SO much!! You are the best!
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top