How to Use Data Validation in Excel with Color (4 Ways)

We have a dataset containing five columns: Serial Number, Candidate Name, Acquired Number, DoB, and Candidate’s Code. We will use different Columns of our dataset to demonstrate different methods for using Data Validation in Excel with color.

How to Use Data Validation in Excel with Color


Method 1 – Using Whole Numbers for Data Validation in Excel with Color

The Acquired Number Column is blank which we will now fill by applying Data Validation. We want to put the condition that only numbers between 40 and 100 can be given as input.

How to Use Data Validation in Excel with Color

  • Select the column where we will apply Data Validation. We have selected the Acquired Number column.

How to Use Data Validation in Excel with Color

  • Go to the Data tab, select Data Tools, and choose Data Validation.

How to Use Data Validation in Excel with Color

  • The Data Validation window will open. Click the Allow box and select Whole number.
  • In the Data box, select Between.

How to Use Data Validation in Excel with Color

  • Put 40 in Minimum and 100 in Maximum.
  • Click OK.

How to Use Data Validation in Excel with Color

  • Enter the values manually.
  • If you try to enter any number less than 40 or more than 100, Excel will show an error message.

How to Use Data Validation in Excel with Color

Let’s put numbers from 40 to 59 in yellow and 60 to 100 in green.

  • Select the column.
  • Go to Conditional Formatting and select New Rule.

How to Use Data Validation in Excel with Color

  • Select Format only cells that contain.
  • Go to the Edit the rule description part.
  • The first box will be Cell Value. Keep it as is for the sample.
  • In the next box, put between. Type 40 and 59 in the following two boxes as the limiting values.
  • Click Format.

How to Use Data Validation in Excel with Color

  • Choose a yellow color from the Fill tab and click OK.

How to Use Data Validation in Excel with Color

  • Click OK again on the first dialog box.

How to Use Data Validation in Excel with Color

  • All the cells of the Acquired Number column with values between 40 and 59 will be colored yellow.

How to Use Data Validation in Excel with Color

  • Repeat the same process for the second formatting rule, with limits between 60 and 100 and a green fill.

How to Use Data Validation in Excel with Color


Method 2 – Creating a Drop-Down List with Color Using Excel Data Validation

Suppose we have a dataset like the previous one with an additional Grade column where we want to input the grade depending on the number range.

  • Put the scoring table next to the dataset.
  • Select the Grade column.

How to Use Data Validation in Excel with Color

  • Open the Data Validation dialog box and select List in Allow.
  • Click on the icon on the far right of the Source box to add the source.

How to Use Data Validation in Excel with Color

  • Select the scoring table’s grade column.
  • Click on the Source button again.

How to Use Data Validation in Excel with Color

  • Click OK in the Data Validation dialogue box.

How to Use Data Validation in Excel with Color

  • You will get a drop-down menu in every cell of the Grade column.
  • Enter a grade for each cell via the drop-downs.

How to Use Data Validation in Excel with Color

  • Here is what we did for the sample.

How to Use Data Validation in Excel with Color

We want to have different colors for different Grades.

  • Open Conditional Formatting.
  • Select Specific Text in the first box, Containing in the second, and click on the Source selector icon.

How to Use Data Validation in Excel with Color

  • Select the A+ cell from the scoring table and click on the selector.

How to Use Data Validation in Excel with Color

  • Click on Format.

How to Use Data Validation in Excel with Color

  • Choose the desired color in Fill and click on OK.

How to Use Data Validation in Excel with Color

  • Press OK in the Conditional Formatting dialogue box.

How to Use Data Validation in Excel with Color

  • We chose a green color for A+.

How to Use Data Validation in Excel with Color

  • Repeat the process for each other grade, selecting a different fill color each time.

How to Use Data Validation in Excel with Color

Read More: How to Perform Data Validation for Alphanumeric Only in Excel


Method 3 – Selecting a Date with Color with Data Validation in Excel

Steps:

We want to sort out candidates depending on their date of birth, where only candidates born between 01-01-1997 and 01-01-2003 are eligible.

  • Select the DoB column.

  • Open Data Validation.
  • In Allow, put Date.
  • For Data, put between.
  • Enter the Start date and the End date. 
  • Click OK.

Candidates born between 01-01-1997 and 31-12-1999 will be marked orange and candidates born between 01-01-2000 and 01-01-2003 will be marked green.

  • Select the DoB Column.

  • Go to New Formatting Rule.
  • Choose Cell Value, then between.
  • Enter the starting and ending date for the category and click Format.

  • Choose a fill color and click OK twice to apply.

  • Repeat the process for every category you want.


Method 4 – Applying Data Validation for Selecting Text Length with Color

Steps:

Suppose we have a dataset with Candidate’s Code in Column F. It’s tough to type the code manually since they don’t have any direct correlation to other values. We will restrict the length of the value with Data Validation.

  • Select the Candidate’s Code column.

  • Go to Data Validation.
  • For Allow, put Text Length.
  • Choose equal to for Data
  • Enter 4 (desired character length) in the Length box.
  • Click OK.

  • If the input is shorter or longer, Excel will show a warning message.

We can color the cells based on the letter in the code.

  • Select the Candidate’s Code column again.

  • Following the procedures shown in Method 3, choose Specific Value and enter the character you want to format with (in this case A for one and B for the other).
  • Choose a color for each category.
  • Repeat the process to make the second category. Here’s our sample result.


Download the Practice Workbook


Related Articles


<< Go Back to Data Validation in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Asif Khan Pranto
Asif Khan Pranto

Md. Asif Khan Pranto worked as an Excel and VBA Content Developer in Exceldemy for over two years and published some articles for the website. He is passionate about exploring new aspects of Excel and VBA. He received his Bachelor of Science in Mechanical Engineering from the Islamic University of Technology. Now, he is pursuing a Master of Development Studies to experience a new spectrum of knowledge. Apart from creating Excel tutorials, he is interested in Data Analysis... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo