User To Allow Enter Text or Numeric Only

User To Allow Enter Text or Numeric Only

Original Question:-

I want to restrict the data entry in range A2:A7 to enter the following:

  1. Numbers greater than 0 & less than 25 i.e. (1 to 24)
  2. Letters: A & L (not even a & l in small letters)

In short user can enter any value meeting the above two conditions and no other value is allowed in this range.

We can use OR, AND, EXACT functions to get the output.

Following is the snapshot of data:




We need to follow the below steps:

  • Select range A2:A7
  • Press ALT + D + L
  • From Settings tab click on Allow drop down & select Custom
  • In Formula box enter the formula as =OR(AND(A2>0,A2<25),EXACT(A2,"A"),EXACT(A2,"L"))




  • Range A2:A7 will accept only the letters either ‘A’ or ‘L’ & numbers between ‘0 to 25’




  • Data validation will pop up error if input is not matching the specified criteria.

In this way we can allow user to enter text or numeric only meeting specific criterias.

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube