Lecture 10
Lecture 10
Conditional Formatting
Conditional formatting in Excel enables you to highlight cells with a certain colour, depending on
the cell's value.
Home tab> Styles group> Conditional Formatting. Click Highlight Cells Rules, Greater Than. Enter a value
and select a formatting style. Click OK.
Result. Excel highlights the cells that are greater than 80. If you change the value in a cell, Excel changes
the format of cell automatically.
You can also highlight cells that are less than a value, between a low and high value, etc.
Top/Bottom Rules
To highlight cells that are above the average of the cells, execute the following steps.
Select the range A1:A10. Home tab> Styles group >Conditional Formatting. Click Top/Bottom Rules,
Above Average.
Select a formatting style. Click OK.
Result. Excel calculates the average and formats the cells that are above this average.
Note: you can also highlight the top 10 items, the top 10 %, etc. TRY
Data Validation
Use data validation in Excel to make sure that users enter certain values into a cell.
Suppose you want to restrict users to enter a whole number between 0 and 10.
2. On the Data tab, in the Data Tools group, click Data Validation.
1
On the Settings tab:
Input Message
Input messages appear when the user selects the cell and tell the user what to enter.
2. Enter a title.
2. Enter a title.
4. Click OK.
Note: to remove data validation from a cell, select the cell, on the Data tab, in the Data Tools group, click
Data Validation, and then click Clear All.
2
Creating a reference to another sheet in Excel
When writing a formula that refers to cells in another worksheet, you can of course type that
other sheet name followed by an exclamation point and a cell reference manually, but this
would be a slow and error-prone way.
A better way is point to the cell(s) in another sheet that you want the formula to refer to, and
let Excel take care of the correct syntax of your sheet reference. To have Excel insert a
reference to another sheet in your formula, do the following:
3
External reference to an open workbook
When the source workbook is open, an Excel external reference includes the workbook name in
square brackets (including the file extension), followed by the sheet name, exclamation point
(!), and the referenced cell or a range of cells. In other words, you use the following reference
format for an open workbook reference:
[Workbook_name]Sheet_name!Cell_address
=A2*[test1.xlsx]Sheet1!A2
External reference when the source is not open, the external reference includes the
entire path.
=A2+'C:\Users\Desktop\[test1.xlsx]Sheet1'!B2