0% found this document useful (0 votes)
10 views

Lecture 10

Uploaded by

Anon son
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lecture 10

Uploaded by

Anon son
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ST 1012 - Basic Statistical Computing

Conditional Formatting

 Conditional formatting in Excel enables you to highlight cells with a certain colour, depending on
the cell's value.

Highlight Cells Rules


To highlight cells that are greater than a value, execute the following steps.
Select the range A1:A10.

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.

To create the data validation rule, execute the following steps.


1. Select cell C2.

2. On the Data tab, in the Data Tools group, click Data Validation.

1
On the Settings tab:

3. In the Allow list, click Whole number.

4. In the Data list, click between.

5. Enter the Minimum and Maximum values.(0 and 10 here)

Input Message
Input messages appear when the user selects the cell and tell the user what to enter.

On the Input Message tab:

1. Check 'Show input message when cell is selected'.

2. Enter a title.

3. Enter an input message.


Error Alert
If users ignore the input message and enter a number that is not valid, you can show them an error alert.

On the Error Alert tab:

1. Check 'Show error alert after invalid data is entered'.

2. Enter a title.

3. Enter an error message.

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:

1. Start typing a formula either in a destination cell or in the formula bar.


2. When it comes to adding a reference to another worksheet, switch to that sheet and select
a cell or a range of cells you want to refer to.
3. Finish typing the formula and press the Enter key to complete it.
For example, if you have quantity sold in sheet 1 and the unit price in sheet 2. You want to
calculate the sales value for each product sheet1 , proceed in the following way:

 Start typing the formula =B2*Sheet2!B2 in cell B2 on sheet 1.


 Switch to sheet Sheet 2, and click on cell B2 there. Excel will immediately insert an
external reference to that cell, as shown in the following screenshot:
A B C
1 Qty Total
2 Apples 12 7200 =B2*Sheet2!B2
3 Oranges 15 11250
4 Grapes 10 12000
5 Bananas 10 1000
Sheet 1
A B
1 Unitprice
2 Apples 600.00
3 Oranges 750.00
4 Grapes 1200.00
5 Bananas 100.00
Sheet2
 Press Enter to complete the formula.

 How to reference another workbook in Excel


In Microsoft Excel formulas, external references to another workbook are displayed in two
ways, depending on whether the source workbook is open or closed.

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

You might also like