How to change cell formatting using a Drop Down list
This article demonstrates how to apply different cell formatting to a cell range based on a Drop Down list, column B contains an Excel Table with numerical values.
The Drop down list in cell D3 lets you choose between five different types of cell formatting, they are:
- No formatting (General)
- % (percentage)
- Numbers formatted as time
- Highlight numbers below average
- Highlight numbers above average
You can, of course, pick whatever cell formatting you want and how many or few as you want. I chose those for demonstrational purposes.
The animated image above shows me selecting different formattings and column B instantly changes based on what I selected. This technique can be useful if you are building a Dashboard.
Here is how I did it.
Create an Excel Table
This step is optional, however, I highly recommend it if you know you will be adding more values later on.
An Excel Table applies Conditional Formatting to new values automatically, this makes it really useful because there is no need to extend CF formatting or change CF formulas when new values are added.
- Select all cells in your data set.
- Go to tab "Insert" on the ribbon.
- Press with left mouse button on "Table" button, a dialog box appears.
- Press with left mouse button on OK button.
You data set has now a different cell formatting applied, this is done every time data is converted to an Excel Table. You can change this if you like.
- Press with left mouse button on any cell in your Excel Table.
- Go to tab "Table Design" on the ribbon.
- Here you have plenty of Table Styles to choose from.
Create a Drop Down list
A Drop Down list lets you control what the user enters in a worksheet, press with left mouse button on the black arrow next to the cell to expand the list.
The list shows valid values the user can select, simply press with left mouse button on a value with the mouse or use up/down arrow keys.
- Select cell D3.
- Go to tab "Data" on the ribbon.
- Press with left mouse button on "Data Validation" button on the ribbon and a dialog box appears.
- Go to tab "Settings" on the dialog box. See image below.
- Select List
- Type: No formatting, %, Time, Above Average, Below Average
- Press with left mouse button on OK button to close the dialog box.
Apply Conditional formatting
Conditional Formatting allows you to format a cell or cell range based on a condition, in this case, the condition is given in cell D3 where we have a Drop Down list located.
We need to create five different CF formulas, each one applying different cell formatting to a column in the Excel Table.
For example, the image above shows that the selected value in the Drop Down list is "Above Average", the corresponding Conditional Formatting formula is activated and highlights values in Excel Table if a number is above the average of all numbers in the "Values" column.
Follow these steps to apply Conditional Formatting to column Values in the Excel Table.
- Select all values in column "Values".
- Go to tab "Home" on the ribbon.
- Press with left mouse button on the "Conditional Formatting" button and a menu appears.
- Press with left mouse button on "New Rule...".
- Copy this formula:
=($D$3="Above Average")*(INDIRECT("Table1[@Values]")>AVERAGE(INDIRECT("Table1[Values]")))
and paste to "Format values where this is true:" - Press with left mouse button on "Format..." button and pick a color. Cells that meet the requirement (return TRUE) in the above formula will be highlighted with this color.
- Press with left mouse button on OK button.
- Press with left mouse button on OK button once again to close the Conditional Formatting dialog box.
- Repeat step 1 to 8 with the remaining cell formattings.
Here are the formulas and formatting:
% formula
The formula checks if the value in cell D3 is %. If true the following formatting is applied:
Time formula
The formula checks if the value in cell D3 is Time. If true the following formatting is applied:
Above Average
In this formula, cell D3 is "Above Average" AND checks if each value is above the average of the table values. If TRUE the cell is highlighted.
Below Average
Cf misc category
Here is how to highlight every other row using conditional formatting. Conditional formatting formula: =ISEVEN(ROW())*OR($B3:$D3<>"") Alternative CF formula: =EVEN(ROW())=ROW() This […]
Question: I have a list that I keep adding rows to. How do i create a border that expands as […]
The picture above shows Conditional Formatting highlighting cells in cell range F3:Y22 based on row and column values in column B […]
Pamela asks: I would like to ask you how to identify PAIR of same numbers, but with a different sign. […]
This article demonstrates a Conditional Formatting formula that lets you highlight cells based on numerical ranges specified in an Excel […]
Conditional formatting category
The image above demonstrates a conditional formatting formula that colors a record if there is at least one record that […]
This article explains how to count cells highlighted with Conditional Formatting (CF). The image above shows data in cell range […]
adam asks: Hi, I have a situation where I want to count if this value is duplicate and if it […]
Question: How do I highlight dates that meet criteria using conditional formatting? Table of contents Highlight values in a column […]
This post demonstrates how to highlight records with the closest value to a criterion, you can also choose to highlight […]
The image above shows rows highlighted based on value in column C being the largest or smallest in that particular […]
This article shows you how to easily identify duplicate rows or records in a list. What's on this webpage Conditional […]
The image above demonstrates a conditional formatting formula applied to an Excel Table containing random data. The Excel Table has […]
Here is how to highlight every other row using conditional formatting. Conditional formatting formula: =ISEVEN(ROW())*OR($B3:$D3<>"") Alternative CF formula: =EVEN(ROW())=ROW() This […]
Question: I have a list that I keep adding rows to. How do i create a border that expands as […]
The image above shows you how to highlight rows with multiple criteria using OR logic. The criteria are found in […]
In this article, I will demonstrate how to search a table using conditional formatting. The criteria highlight matching column and […]
Today I am going to show you how to quickly compare two tables using Conditional Formatting (CF). I am going […]
The image above demonstrates a conditional formatting formula that highlights duplicate items based on date. The first instance is not highlighted, […]
A conditional formatting formula highlights values in column B that also exist in column D. =COUNTIF($D$3:$D$7,B3) The same thing happens […]
In this post I am going to try to explain formula basics in conditional formatting. It is really good if […]
The image above shows conditional formatting highlighting unique distinct values, duplicates are not highlighted. Conditional Formatting Formula: =COUNTIF($B$3:B3, B3)=1 The […]
In this blog post I will demonstrate a conditional formatting formula that will highlight common records in two lists. The […]
The image above demonstrates a conditional formatting formula that highlights records that only exist in one table. There are two […]
Drop down lists category
This article explains how to build dependent drop down lists. Here is a list of order numbers and products. We […]
Question: How do I create a drop-down list with unique distinct alphabetically sorted values? Table of contents Sort values using […]
Josh asks: now if i only knew how to apply these dependent dropdown selections to a filter, i'd be set. […]
This article demonstrates different ways to reference an Excel defined Table in a drop-down list and Conditional Formatting. There are […]
This article demonstrates how to set up dependent drop-down lists in multiple cells. The drop-down lists are populated based on […]
This article demonstrates how to run a VBA macro using a Drop Down list. The Drop Down list contains two […]
In this article I will demonstrate how to quickly change chart data range utilizing a combobox (drop-down list). The above […]
In this article, I am going to show you how to quickly change Pivot Table data source using a drop-down […]
This article describes how to create a drop-down list populated with sorted values from A to Z. The sorted list […]
A drop-down list in Excel prevents a user from entering an invalid value in a cell. Entering a value that […]
Sharmila asks: How can i use these list for multiple rows? I would like to use these lists for multiple […]
This article demonstrates a basic invoice template I created. It lets you use dropdown lists to quickly select products on […]
I will in this article demonstrate how to use a value from a drop-down list and use it to do […]
I will in this article demonstrate how to set up two drop down lists linked to an Excel chart, the […]
Aynsley Wall asks: I have a spreadsheet that I use for 3 different companies. What I would really like to […]
This article describes how to create a map in Excel, the map is an x y scatter chart with an […]
Josh asks: I have this working right now with 6 drop downs/lists. I wanted to see if you possibly know […]
This article demonstrates how to populate a drop down list with filtered values from an Excel defined Table. The animated […]
Question: Is there a way to have a unique list generated from a list? Meaning I have a sheet that […]
The drop down calendar in the image above uses a "calculation" sheet and a named range. You can copy the drop-down […]
Functions in this article
More than 1300 Excel formulas
Conditional Formatting categories
Excel categories
3 Responses to “How to change cell formatting using a Drop Down list”
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Something doesn't work quite right with the above and below average conditional formattings.
Brilliant nonetheless.
At least not in the version I opened and ran on Excel 2010
Cape,
Something doesn't work quite right with the above and below average conditional formattings.
What happens, what is wrong? I have excel 2010.