Introducing Formulas and Functions

Một phần của tài liệu Excel 2019 3 in 1 beginners guide + formulas and functions + advanced methods to learn excel (Trang 193 - 200)

Formulas bring out the usefulness of a spreadsheet program. Formulas are used in the Excel worksheet to makes use of data stored to calculate results.

When there’s a change in data, the system automatically updates itself, thereby saving you the stress of re-calculating.

Understanding Formula Basics

A formula deals with a special code that is typed into a cell. It carries out some calculation and then delivers a result, which is shown in the cell. The formulas’ text and values are found in other cells, which makes it possible for the data to be changed easily as well as endow your worksheet with a dynamic look.

An equal sign usually starts with any formula. Other elements included are:

Text or values

Functions of the worksheet (like AVERAGE and SUM).

Cell references (like ranges and cells)

Mathematical operators like (* for multiplication and + for addition)

After the formula is entered, the calculated result is displayed in the cell.

When the cell is selected, the formula bar shows the formula that resulted in the calculation

As mentioned earlier, an equal sign starts all formulas; this helps excel in telling the difference between a plain text and a formula.

Making use of Operators in Formulas

Excel formulas support different operators. Operators are those symbols indicating whatever mathematical operation you wish to perform. Asides this,

Excel includes lots of built-in functions that let users carry out additional calculations. Of course, lots of operators can be used to perform different calculations.

The table below shows some operators that are used in Excel formulas

Operator Name

* Multiplication

- Subtraction

+ Addition

/ Division

^ Exponentiation

= Equal to

< Less than

> Greater than

<= Less than or equal to

Operator Name

>= Greater than or equal to

<> Not equal to

& Concatenation

Understanding what operator precedence means in Excel Formulas

When Excel is calculating a formula's value, it utilizes some specific rules to tell how the different parts of the formula will be calculated. These rules have to be understood to ensure accurate results.

The table below shows the various operators and their precedence Symbol Operator Precedence

^ Exponentiation 1

/ Division 2

* Multiplication 2

- Subtraction 3

+ Addition 3

& Concatenation 4

> Greater than 5

< Less than 5

= Equal to 5

Parentheses can be used to override the built-in preference order of Excel.

Usually, the first to be evaluated are the expressions stated within parentheses. For instance, the formula below utilizes parentheses to control how the calculations should occur in a specific order. Here, we have cell B3 subtracted from cell B2, then the result now multiplied by cell B4:

=(B2-B3)*B4

Had you entered the formula without including the parentheses, then a different answer will be given by Excel. Because there’s higher precedence for multiplication, cell B4 is multiplied by cell B3. The result obtained here is then subtracted from the cell B2, which is quite different from what the user needed.

The formula excluding the parenthesis looks this way:

=B2-B3*B4

Parentheses can also be nested within formulas, which is to include them inside anther or other parentheses. By so doing, the most nested expression is evaluated first and then continues working its way from there.

For instance, here’s a formula using nested parenthesis:

= (B2*C2) + (B3*C3) + (B4*C4))* B6

In this formula, we can find four sets of parentheses: the fourth set nests the remaining three sets. Using Excel, the nested set of parentheses is evaluated one by one by Excel, and then the three results are summed up. This value is then multiplied by the cell B6 Value.

Though four sets of parentheses are found in the preceding formula, the only important one is the outer set. If operator precedence is well understood, them the formula can be easily rewritten as follows:

= (B2*C2+B3*C3+B4*C4) *B6

Most people will agree that making use of additional parentheses will throw more light on the calculation. Remember that operators working at the same precedence level like division and multiplication are performed for the left to

right unless the parentheses indicate a different order.

Of course, any parenthesis on the left must include a right parenthesis to match. If your formula contains lots of nested parentheses levels, then it could be difficult keeping them straight. If, for some reason, the parentheses fail to match, then a message will be displayed by Excel indicating the issue and then preventing you from entering the formula.

Making use of worksheet functions in your formulas

Most of the formulas created makes use of worksheet functions. With these functions, your formulas’ power will be enhanced, and then impossible or difficult calculations will be performed. For instance, to calculate an angle’s cosine, you can make use of the COS function. Mathematical operators alone cannot be used to perform this complicated calculation.

The function of a worksheet can help you simplify a formula. For instance, if you want to calculate the mean or average a set of values in seven cells (A1:A7) without making use of a function, then the formula needs to be constructed like this:

= (A1+A2+A3+A4+A5+A6+A7)/7

This doesn’t look too good, right? Another stressful part of this is that the formula will have to be edited if another cell is included in the range. The good thing here is that this formula can be replaced with a simpler one that makes use of the worksheet functions of Excel, which is AVERAGE:

=AVERAGE (A1:A10)

The formula above explains how the use of a function can help you perform calculations that are not possible normally. Just imagine you want to know what the highest value in a range is. The answer cannot be generated from any formula unless you make use of a function. Below is a formula utilizing the MAX function to reveal the largest value included in the range A1:D100:

=MAX (A1:D100)

In some cases, functions can also do away with manual editing. Let’s say you have a worksheet containing 500 names in cells A1:A500 with all the names written in block letters. Your boss then sees this listing and tells you that these names will have to be mail-merged, then using block letters for all will not be possible. This means that WILSON J. CLARK must now be written as Wilson J. Clark. This would become very stressful as you’ll have t start re-

entering the list; however, with a simple formula like the PROPER function, these names can be converted easily and quickly.

=PROPER (A1)

Enter the formula above in cell B1 once then copy it to the rest 499 rows.

Next, select B1:B500, then to copy the range, click on Home, then Clipboard, then Copy. Next, with the selection of B1:B500 still in place, click on Home, then Clipboard, and then Paste Values (V), so that the formulas will be converted to values. Next, the original column should be deleted, and then you’ve just completed hours of work in just one minute or less.

Let’s take another example to cement the fact that functions are very powerful and can perform great tasks. Take, for instance, a worksheet for calculating sales commissions. If the person in charge of sales sold products worth $75,000 or more, there’s a 7.5 percent commission rate, and anything less the commission is 5 percent.

Without making use of a function, then two different formulas will have to be created, ensuring the right formula is used for each amount of sales.

However, there’s a better way to solve this; this has to do with writing a formula that includes the IF function ensuring that the right commission is calculated, no matter the sales amount:

=IF (A1< 75000, A1*5%, A1*7.5%)

With this formula, the value of cell A1, which houses the number of sales will be checked. If this value is below 75,000, cell A1 will be multiplied by 5%. Here, three arguments are used, which are distinguished by commas.

Function Arguments

In the functions stated above, they all made use of parentheses. The information contained in these parentheses are the function arguments.

The ways functions make use of arguments vary. Depending on the task, one of these may be used by any function:

Optional arguments One argument No argument

Fixed number of arguments

An indeterminate number of arguments

The NOW function is a function with no argument. This function returns the current time and date. Even if this is the case, you must give a set with empty parentheses, such as:

=NOW ()

If more than one argument is found in a function, then each argument must be separated with a comma. When we talk of function arguments, Excel is very flexible. An argument can comprise of literal values, expressions, a cell reference, literal text settings, as well as other functions. Below are some functions that use different types of arguments.

Literal value: =SORT (121) Expression: -SQRT (183+12) Cell reference: =SUM (A1:A24)

Literal text string: =PROPER (“wilson j. clark”)

To conclude this section, Excel has over 450 built-in functions. This is more than enough; however, if you require more, you can download them or buy extra specialized functions from 3rd-party suppliers.

Entering of Formulas into your Excel Worksheet

As stated earlier, all formulas must start with an equal sign to let Excel know that it’s a formula that is contained in the cell and not a text. There are two ways of entering a formula into the cell, which is by pointing to cell references or entering it manually.

Extra assistance is provided by Excel anytime you create formulas by revealing a list containing range names and function names. The items present in this list have to do with what you’ve typed beforehand.

The Formula AutoComplete Feature

With the auto-complete feature, entering formulas become very easy. As soon as you begin with typing the formula in mind, Excel will come to your aid by presenting you with the possible options.

The following items are included in the Formula AutoComplete feature, each

with its icon.

User-defined functions Excel functions (built-in)

Table structure references, which are used in identifying the portions of any table

Enumerated arguments Defined names

Entering a Formula Manually

In a particular cell, type the usual equal sign = and then input the formula.

The characters are shown in the cell as well as the Formula bar as you type.

Also, it is possible to make use of all the editing keys to enter a formula.

Entering a Formula by Pointing

Although it is possible to type in the whole formula, Excel offers an alternative method that is easier, less prone to errors, and faster. This method still has to do with typing it manually, but the cell references can be pointed to, instead of typing these values manually. For instance, we want to input the formula =A1 + A2 into the cell A3, follow these simple steps

Select the cell A3

To start the formula, type (=) an equal sign Press the arrow pointing up twice

Type the (+) plus sign

Press the arrow pointing up again

Press Enter and the formula is completed.

How to Paste range names into a formula

If your formula makes use of named ranges or cells, then the name can either be typed in place of the address or select this name from a list and request Excel to input it automatically. There are three ways of inserting range name into formulas

Một phần của tài liệu Excel 2019 3 in 1 beginners guide + formulas and functions + advanced methods to learn excel (Trang 193 - 200)

Tải bản đầy đủ (PDF)

(362 trang)