zaro

How to Set a Number Limit in Excel?

Published in Excel Data Validation 3 mins read

You can set a number limit in Excel using the Data Validation feature, restricting the values users can enter into a cell or range of cells.

Here's a breakdown of how to do it:

Steps:

  1. Select the Cell(s): Begin by selecting the cell or range of cells where you want to impose the number limit.

  2. Access Data Validation: Go to the "Data" tab on the Excel ribbon and click on "Data Validation." You'll find it in the "Data Tools" group.

  3. Set Validation Criteria: The Data Validation dialog box will appear. In the "Settings" tab:

    • Allow: From the "Allow" dropdown menu, choose "Whole number" or "Decimal," depending on the type of numbers you want to allow. "Whole number" restricts entries to integers, while "Decimal" allows for numbers with decimal points.

    • Data: This option specifies the type of restriction. Choose from options like:

      • Between: Allows numbers within a specified range (minimum and maximum).
      • Not between: Allows numbers outside a specified range.
      • Equal to: Allows only a specific number.
      • Not equal to: Allows any number except a specific number.
      • Greater than: Allows numbers larger than a specified value.
      • Less than: Allows numbers smaller than a specified value.
      • Greater than or equal to: Allows numbers greater than or equal to a specified value.
      • Less than or equal to: Allows numbers less than or equal to a specified value.
    • Minimum: Enter the minimum acceptable value (if applicable).

    • Maximum: Enter the maximum acceptable value (if applicable).

    • Value: Enter the specific value (if applicable for "Equal to" or "Not equal to").

  4. Input Message (Optional): Go to the "Input Message" tab to create a helpful message that appears when the user selects the cell. This can explain the allowed range or the expected input.

    • Title: Enter a title for the message box (e.g., "Allowed Value").
    • Input message: Write a clear message explaining the allowed input (e.g., "Enter a number between 1 and 100.").
  5. Error Alert (Optional): Go to the "Error Alert" tab to customize the message that appears if the user enters an invalid value.

    • Style: Choose the style of error alert:

      • Stop: Prevents the user from entering the invalid value.
      • Warning: Displays a warning but allows the user to override it and enter the invalid value.
      • Information: Displays an informational message but allows the user to enter the invalid value.
    • Title: Enter a title for the error message box (e.g., "Invalid Entry").

    • Error message: Write a message explaining why the entry is invalid (e.g., "The value must be between 1 and 100.").

  6. Apply Changes: Click "OK" to apply the data validation rules.

Example:

To restrict cell A1 to numbers between 1 and 100:

  1. Select cell A1.
  2. Go to Data > Data Validation.
  3. In the "Settings" tab:
    • Allow: Whole number
    • Data: Between
    • Minimum: 1
    • Maximum: 100
  4. Click "OK."

Now, if you try to enter a number outside the range of 1 to 100 in cell A1, Excel will display an error message.