Fantastic Formulas

17
Microsoft Excel 2002 & 2003 Fantastic Formulas Challenge City Learning Centre North Avenue Bradford BD8 7ND Tel: 01274 362075 www.challengeclc.co.uk

description

MICROSOFT EXCEL FORMULAS EFFECTIVE USE.

Transcript of Fantastic Formulas

Page 1: Fantastic Formulas

Microsoft Excel2002 & 2003

Fantastic Formulas

Challenge City Learning CentreNorth Avenue

BradfordBD8 7ND

Tel: 01274 362075

www.challengeclc.co.uk

Page 2: Fantastic Formulas

Contents

Formulas____________________________________________________________3Commonly Used Formula______________________________________________3

Sum______________________________________________________________3Average___________________________________________________________3Min_______________________________________________________________3MAX______________________________________________________________4COUNT____________________________________________________________4COUNTIF__________________________________________________________4COUNTA___________________________________________________________4PROPER, UPPER AND LOWER________________________________________5TRIM______________________________________________________________5CONCATENATE____________________________________________________6LEFT______________________________________________________________6RIGHT_____________________________________________________________6TODAY____________________________________________________________7NOW______________________________________________________________7VLOOKUP_________________________________________________________7HLOOKUP_________________________________________________________8IF_________________________________________________________________8Evaluate A Nested Formula___________________________________________10

© Challenge City Learning Centre 2 of 10 May 2006

Page 3: Fantastic Formulas

Formulas

Formulas are equations that perform calculations on values in your worksheet. A formula starts with an equal sign =.

Excel has also a number of pre-written formulas that carry out common and more complicated calculations. They simplify the process of entering formulas and are known as functions.

Commonly Used Formula

SumAdds all neighbouring numbers in a row or column.

In this example, to calculate the total in cell B9 use:

=SUM(b4:b8)

AverageCalculates the average (mean) figure.

In this example, to calculate the average price of all the tuck shop items, use:

=AVERAGE(b4:b8)

MinIdentifies the minimum (lowest) number in a range of data.

In this example, to identify the lowest price, use:

=MIN(b4:b8)

© Challenge City Learning Centre 3 of 10 May 2006

Page 4: Fantastic Formulas

MAXIdentifies the maximum (highest) figure in a range of data.

In this example, to identify the most expensive item use:

=MAX(b4:b8)

COUNTCounts the number of cells that contain numbers.

In this example, to count the number of items in the tuck shop use:

=COUNT(b4:b8)

COUNTIFCounts the number of cells within a range that meet the given criteria.

In this example, to count the items that cost £0.30 use:

=COUNTIF(B4:B8,"=0.30")

COUNTACounts the number of cells that contain data (not empty) in a range or array.

In this example, to count the cells containing data use:

=COUNTA(B4:B8)

© Challenge City Learning Centre 4 of 10 May 2006

The criteria

Page 5: Fantastic Formulas

Text FormulasText formulas can be a great time saver, particularly if you have copied information from another application, or imported information that is displayed incorrectly.

PROPER, UPPER AND LOWERCapitalises the first letter in a text string and any other letters in text that follow any character other than a letter. It converts all other letters to lowercase letters.

To change… Use…amy to Amy =PROPER(A4)

amy Franks to all upper case =UPPER(A4)

Amy Franks to all lower case =LOWER(A4)

Replicate these and you will change all the values to the required case.

TRIMRemoves all spaces from text except for single spaces between words. You can use TRIM on text that you have received from another application that may have irregular spacing.

To remove the space before amy Franks use:

=TRIM(A4)

To remove the space and change the case at the same time use:

=PROPER(TRIM(A4))

You can replicate these formulas to amend the other cells, removing spaces and altering the case as required.

© Challenge City Learning Centre 5 of 10 May 2006

Page 6: Fantastic Formulas

CONCATENATEJoins several text strings into one text string. For example if you have the first name in one cell and the surname in an adjoining cell, this function will join the two together:

To join Amy and Franks together, use:

=CONCATENATE(A4," ",B4)

The inverted commas denote a space.

LEFTSeparates characters on the left.

In this example, to separate the ID number from the name use

=LEFT(A4,5)

This tells Excel to start on the left and take the first five characters.

RIGHTSeparates characters on the right.

In this example, to separate the Class from the name use:

=RIGHT(A4,2)

© Challenge City Learning Centre 6 of 10 May 2006

Page 7: Fantastic Formulas

The cell value you wish to look up in

your separate table.

The range of the table to look up (table

array).

The column number of the actual value you are looking for.

False: to find an exact match,

True: to find the nearest match.

TODAYReturns the serial number of the current date. The serial number is the date-time code used by Microsoft Excel for date and time calculations. (If the cell format was General before the function was entered, the result is formatted as a date.)

To input the date in cell B3 use:

=TODAY()

NOWReturns the serial number of the current date and time. (If the cell format was General before the function was entered, the result is formatted as a date.)

To input the date in cell B3 use:

=NOW()

VLOOKUPSearches for a value from your spreadsheet in a separate table of data (where data runs vertically in columns) and returns a value in from that separate table.

To add the supplier (currently held in a separate table of data) use:

=VLOOKUP(A6,$A$17:$B$21,2,FALSE)

© Challenge City Learning Centre 7 of 10 May 2006

Page 8: Fantastic Formulas

The cell value you

wish to look up in your separate

table.

The range of the table to look up (table array).

The column number of the

actual value you are looking for.

False: to find an exact match,

True: to find the nearest match.

The logical test: can only be answered True or False.

The value to be returned if test is TRUE

The value to be returned if test is FALSE

HLOOKUPSearches for a value from your spreadsheet in a separate table of data (where data runs horizontally in rows) and returns a value in from that separate table.

To add the Fat Content (currently held in a separate horizontal table of data) use:

=HLOOKUP(A6,$A$24:$E$25,2,FALSE)

IFReturns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE. Use IF to conduct conditional tests on values and formulas.

Use IF function to determine the healthy category for each item – if the Fat Content is less than 18 then enter Green. If not, enter Red:

=IF(C6<18,"Green","Red")

© Challenge City Learning Centre 8 of 10 May 2006

Page 9: Fantastic Formulas

Insert FunctionTyping in more complicated formulas can be difficult and time-consuming. The Insert Function button guides you through the process and builds the formula accordingly.

1. Click the Insert Function button:

The dialog box will be displayed.

2. The most recently used functions are displayed. If the function you wish to use is not displayed, click the ‘Or select a category’ drop down list. If you know which category it is in then select it, if not select All.

The Function Arguments dialog box is then displayed:

3. Follow the information at the bottom of the box, to build the formula.

© Challenge City Learning Centre 9 of 10 May 2006

Page 10: Fantastic Formulas

Nested FormulasIn certain cases, you may need to use a function as one of the arguments of another function. (Arguments: the values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.)

For example, the following formula uses a nested AVERAGE function and compares the result with the value 50.

Valid returns    When a nested function is used as an argument, it must return the same type of value that the argument uses. For example, if the argument returns a TRUE or FALSE value, then the nested function must return a TRUE or FALSE. If it doesn't, Microsoft Excel displays a #VALUE! error value.

Nesting level limits    A formula can contain up to seven levels of nested functions. When Function B is used as an argument in Function A, Function B is a second-level function.

For instance, the AVERAGE function and the SUM function are both second-level functions because they are arguments of the IF function. A function nested within the AVERAGE function would be a third-level function, and so on.

Evaluate A Nested FormulaYou can see the different parts of a nested formula evaluated in the order the formula is calculated.

For example, you can see this in the following formula where the function AVERAGE(F2:F5) is shown as its value, 80.

=IF(AVERAGE(F2:F5)>50,SUM(G2:G5),0) as=IF(80>50,SUM(G2:G5),0)

1. Select the cell you want to evaluate. Only one cell can be evaluated at a time.

2. On the Tools menu, point to Formula Auditing, and then click Evaluate Formula.

3. Click Evaluate to examine the value of the underlined reference. The result of the evaluation is shown in italics.

If the underlined part of the formula is a reference to another formula, click Step In to display the other formula in the Evaluation box. Click Step Out to go back to the previous cell and formula.

4. Continue until each part of the formula has been evaluated.

To see the evaluation again, click Restart.

To end the evaluation, click Close.

© Challenge City Learning Centre 10 of 10 May 2006