Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to the Excel ‘IF’ Function. 2 What is the ‘IF’ Function? The calculation is based on a condition that is either TRUE or FALSE. An Excel.

Similar presentations


Presentation on theme: "1 Introduction to the Excel ‘IF’ Function. 2 What is the ‘IF’ Function? The calculation is based on a condition that is either TRUE or FALSE. An Excel."— Presentation transcript:

1 1 Introduction to the Excel ‘IF’ Function

2 2 What is the ‘IF’ Function? The calculation is based on a condition that is either TRUE or FALSE. An Excel worksheet tool which enables the user to apply conditional tests on values and formulae. The syntax, ie the structure, of an IF formula has 3 arguments (elements), described on the next 3 slides.

3 3 The 3 Arguments (Elements) 1 Logical Test – Any value or expression which can be deemed TRUE or FALSE. For example, B6=200 is a logical expression. If the value is cell B6 in an Excel worksheet is equal to 200 the expression B6=200 is, therefore, TRUE. Otherwise the expression would be FALSE. The formula required to display this expression is shown below. =IF(B6=200, “TRUE”, “FALSE”)

4 4 The 3 Arguments (Elements) (cont) 2 Value if true – Is the value true? Is further action necessary? If nothing is entered in the formula, TRUE is displayed. For example, if the argument in the text string is “Within Budget” and the Logical Test evaluates to TRUE, then the IF function displays the text “Within Budget”. The formula required to display this expression is shown below. Assume a “Within Budget” figure of £1,000 and cell C10 displays £975. =IF(C10<=1000, “Within Budget”, “Over Budget”)

5 5 The 3 Arguments (Elements) (cont) 3 Value if false – What action is to be taken if the value is FALSE? If nothing is entered in the formula, FALSE is displayed. For example, if the argument in the test string is “Over Budget”, and the Logical Test argument evaluates to FALSE, then the IF function displays the text “Over Budget”. The formula required to display this expression is the similar to the previous one, but cell D10 displays an over budget figure of £1,125. =IF(D10<=1000, “Within Budget”, “Over Budget”)

6 6 The IF function is therefore used when working with Excel worksheets when it is necessary to determine which of 2 values to use when making calculations. The IF function checks a condition that must be either true or false. If the condition is true, the function returns (displays) one value. If the condition is false, the function returns another value.

7 7 PRACTICAL EXAMPLE (A) Open the Excel file Exams.xls. In Cell D4, key-in the formula: =IF(C4>=50,“Pass”,“Fail”) Press the RETURN key. The result is shown on the next slide. The formula below determines whether a candidate has passed or failed an exam.

8 8 PRACTICAL EXAMPLE (A) (cont) The formula =IF(C4>=50,“Pass”,“Fail”) returns the word Fail in Cell D4. Position the cursor in this corner and it changes to a black cross. Hold down the mouse button and dragthe cursor downwards to cell D22. All the cells in column D now display either Pass or Fail (see next slide).

9 9 PRACTICAL EXAMPLE (A) (cont)

10 10 PRACTICAL EXAMPLE (B) Open the Excel file Budget.xls.

11 11 PRACTICAL EXAMPLE (B) (cont) In cell B24, key-in the following formula, then press ENTER. =IF(B22<7000,” “,”Over Budget”) In this example, the double quotes with a blank space between them ensures that if the Total Payments figure for January in cell B22 is less than £7,000, nothing will appear in cell B24, ie payments are within budget. However, if Total Payments for February to June are over budget, this will be indicated by an “Over Budget” warning text in the appropriate cells.

12 12 PRACTICAL EXAMPLE (B) (cont) Click on cell B24, which contains the formula (but it is not displayed) and drag the black cross to the right, to cell G24.

13 13 PRACTICAL EXAMPLE (B) (cont) It is now clear that Payments for the months of March, April and June are over budget.

14 14 PRACTICAL EXAMPLE (C) This example compares predicted expenses against actual expenses for a period of 3 months. Open the Excel file Budget2.xls. In cell C24, key-in the formula =IF(C22>B22,”Over Budget”,”OK”)

15 15 PRACTICAL EXAMPLE (C) (cont) An Over Budget statement appears in cell C24.

16 16 PRACTICAL EXAMPLE (C) (cont) Do the same for the months of February and March and the worksheet looks like this.


Download ppt "1 Introduction to the Excel ‘IF’ Function. 2 What is the ‘IF’ Function? The calculation is based on a condition that is either TRUE or FALSE. An Excel."

Similar presentations


Ads by Google