top of page

You are learning Data Validation in MS Excel

How to use data validation with custom date formats in Excel?

Here's how to use data validation with custom date formats in Excel:

1. Format Cells for Custom Date Display:

- Select the cell(s) where you want to allow date entry.
- Right-click and choose "Format Cells."
- In the "Format Cells" window, go to the "Number" tab (or "Custom" depending on your Excel version).
- Choose a predefined date format close to your desired format (e.g., "DD-MMM-YYYY" for day-month-year). You can use these formats as a base for customization.
- If you need a completely different format, click on "Custom" and enter the desired code using placeholders like:
- d: Day (1 or 01)
- m: Month (1-12 or short name)
- mm: Month (01-12)
- yyyy: Four-digit year
- yy: Two-digit year
- Click "OK" to apply the custom date format to your selected cells.

2. Set Up Data Validation with Date Allowance:

- With the formatted cells selected, navigate to the "Data" tab.
- Click on "Data Validation" in the "Data Tools" group.
- In the "Data Validation" window, under "Allow," choose "Date" from the dropdown menu.
- This allows data entry only in a recognized date format.

3. Optional: Set Date Range (for further restriction):

- Under "Criteria," you can optionally set a valid date range to restrict entries within specific limits.
- Choose "Between" and enter the start and end dates in the respective boxes.

4. Input Message and Error Message (Optional):

- In the "Input Message" tab, you can enter a message that appears when users hover over the cell, explaining the expected date format.
- In the "Error Alert" tab, you can create a custom error message that pops up if users enter an invalid date.

5. Click "OK" to finalize the data validation settings.

Now, users can only enter dates in the formatted cells, and Excel will restrict any data that doesn't comply with the chosen format or the optional date range (if set).

bottom of page