Hands-On Lab: ID Data Validation Without Script

⏳ Duration: 1–2 Hours

🎯 Level: Beginner – Intermediate

🧠 Method: Hands-on practice

📦 Format: Interactive, offline-ready

📌 Requirement: Able to enter data in Excel

🎯 Goal: Participants can create simple data validations (unique ID, proper format) without macros/VBA.

Sponsored

Many Excel forms require users to enter a unique ID or code. But how can we ensure the input is not blank, not duplicated, and follows a specific format? The answer: use Excel's built-in Data Validation feature — no scripting needed!

📦 Case Study 1 – ID Format

You're creating a participant list. Each participant must have an ID that follows these rules:

✨ Steps

  1. Select the column where IDs will be entered (e.g., column B).
  2. Go to Data → Data Validation → Data Validation.
  3. Select Custom and enter the following formula:
    =AND(LEFT(B2,1)="A", ISNUMBER(VALUE(RIGHT(B2,5))), LEN(B2)=6)
  4. Check Ignore blank and add an error message in the “Error Alert” tab. Click OK.

📦 Case Study 2 – Prevent Duplicate IDs

This time, you want to ensure each ID is unique — no two participants can have the same ID.

✨ Steps

  1. Select the column where participant IDs will be entered (e.g., column B).
  2. Go to Data → Data Validation → Data Validation.
  3. Select Custom and enter this formula:
    =COUNTIF($B$2:$B$100,B2)=1
  4. Check Ignore blank and add an error message in the “Error Alert” tab. Click OK.

🧭 Important Notes

💡 What is a Helper Cell?

A helper cell is an extra column that helps calculate or validate data in your main column.

For example, if your validation formula is too long or complex to fit directly into Data Validation, you can write it in column C first:

=AND(LEFT(B2,1)="A", ISNUMBER(VALUE(RIGHT(B2,5))), LEN(B2)=6)

Then apply Data Validation in column B using a formula like:

=C2=TRUE

Column C acts like an “assistant” for validation, while column B is where users actually enter data.

Use a helper cell if the validation formula is too long or hard to understand directly in the Data Validation box.

Excel Data Validation Menu
Open the Data Validation menu from the Data tab.
Formula input field for validation
Use a Custom formula to validate ID format.
Data Validation error message
Display an error message when the format is wrong.

📝 Practice:

  1. Create a student registration table with columns: ID, Name, and Class.
  2. Apply validation to the ID column as shown above.
  3. Also add automatic formatting if an ID is empty or duplicated.
Sponsored

Want to Learn Excel and Computer Skills for Free?

Visit our complete guides and join free classes from TTC: