Want to validate cells to only have a letter X or a number between 1 and 25

Want to validate cells C6 through V300 so only the letter X (capital or lowercase) or a number between 1 and  25 can be entered in the cell.  Trying to figure out a custom formula for this.  Thank you.
anctechAsked:
Who is Participating?
 
barry houdiniConnect With a Mentor Commented:
Select that range and use this formula in custom validation

=IF(C6="X",TRUE,AND(C6>=1,C6<=25))

regards, barry
0
 
anctechAuthor Commented:
Very fast response.  Thank you.
0
 
barry houdiniCommented:
Thanks

Note that the suggested formula will also allow decimals like 6.34 (because that's between 1 and 25) . If you only want integers change to

=IF(C6="X",TRUE,AND(C6>=1,C6<=25,C6-INT(C6)=0))

regards, barry
0
 
anctechAuthor Commented:
Just want whole numbers to be entered so would your second formula be better for that.
0
 
barry houdiniCommented:
Yes, second version will allow integers only

regards, barry
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.