# 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.
###### Who is Participating?

Commented:
Select that range and use this formula in custom validation

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

regards, barry
0

Author Commented:
Very fast response.  Thank you.
0

Commented:
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

Author Commented:
Just want whole numbers to be entered so would your second formula be better for that.
0

Commented:
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.