Computer Fund Part IV Lesson 03
Computer Fund Part IV Lesson 03
LESSON 3
IV-3.2
Computer Fundamentals
Building Formulas
" formula is the written expression of a calculation to be performed by Excel. When you enter a formula into a cell, the formula is stored internally while the calculated result appears in the cell. " formula is a mathematical e$uation consisting of two elements/ operands and mathematical operators. he operands identify the values to be used in the calculation. "n operand can be a constant value, another formula, or a reference to a cell or range of cells. Mathematical operators specify what calculations are to be performed with the values. o allow Excel to distinguish formulas from data, all formulas begin with an e$ual sign 012 or a plus sign 032. o view a formula, click the cell containing the formula. he formula will appear in the Formula bar. %ou can use any of the following mathematical operators in a formula.
Operator
4 5 6 3 &
Meaning
Exponentiation Multiplication 7ivision "ddition 8ubtraction
When a formula contains two or more operators, operations are not necessarily performed in the order in which you read the formula9that is, left to right. he order in which operations are performed is determined by operator priority, as defined by the rules of mathematics. #or example, exponentiation is always performed before any other operation. Multiplication and division are next on the priority list, performed se$uentially from left to right. #inally, addition and subtraction are performed, again from left to right. .onsider the following e$uation. :3;5<6-&=1> #irst, four is multiplied by six, and the result is divided by three. wo is then added to the result, and one is subtracted. ?perations contained within parentheses are completed before those outside parentheses. %ou can override the standard operator priorities by using parentheses. hus, the following e$uation is calculated differently than the previous one. 0: 3 ;2 5 < 6 0- & =2 1 =@ In this formula, two and four are added first, and the result is multiplied by six. #inally, that result is divided by the result of three minus one.
IV-3.3
.reating a formula is similar to entering text and numbers in cells. o begin, you select the cell in which you want the formula to appear. hen you can use one of two methods to create the formula. In the first method, you type the formula, including cell addresses, constant values, and mathematical operators, directly into the cell. o mark the entry as a formula, you start by typing an e$ual sign. In the second method, you paste the references for a cell or range of cells in the #ormula bar. %ou then complete the formula by typing any operators, constant values, or parentheses. "s you build a formula, it appears in the #ormula bar and the cell itself. When you have completed the formula, the cell displays the result of the formula, and the #ormula bar displays the formula itself. he reservations manager at "dventure Works has tracked the number of nights each type of room was occupied in each month for the last year. o calculate occupancy rates, he must find the total number of nights occupied for each month, divide that total by the number of rooms, and finally divide that result by the number of nights in the month. In this exercise, you open a worksheet and create basic formulas in the worksheet.
1 2 Open the Lodging Usage workbook from the Part IV, Lesson03 folder in the Computer Fundamentals Pra ti e folder! Cli k ell C", t#pe =C !C"!C#. $s #ou t#pe ea h ell referen e, the ell being referred to is sele ted and the sele tion border appears in a spe ifi olor! %his olor mat hes the olor of the te&t used for the ell referen e! Press 'nter! %he total of the ells ("0)* appears in ell C"! Cli k ell C+3, t#pe =, and then li k ell C,! C, is added to the formula! %he ell #ou li k is olor- oded and shows a flashing mar.uee border! %#pe %, li k ell $,, and then li k the 'nter button on the Formula bar! '& el ompletes the formula and displa#s the ratio of ells C, and $, (30!/,*! " 0 roll down, if ne essar#, and li k ell C/+! Cli k in the Formula bar, t#pe =C13%31, and then li k the 'nter button on the Formula bar! '& el al ulates the o upan # rate of halet rooms for the month of 1anuar# (0!"2,)+*, and the results appear in ell C/+! On the Format menu, li k Cells! 0wit h to the 3umber tab if ne essar# and li k Per entage on the Categor# list!
4hen #ou t#pe a ell address in a formula, it doesn5t matter if #ou use upper ase or lower ase letters! For e&le, referen es B8 and b8 refer to the same ell!
3 $
# &
IV-3.$
Computer Fundamentals
'
Cli k O6 to a ept the default number of de imal pla es (/*! %he 7alue in C/+ appears as a per entage!
tip
8# default, '& el al ulates formulas automati all#! %o hange when a formula is al ulated, on the %ools menu, li k Options, and on the Cal ulation tab, sele t the desired option!
Copying Formulas
%ou might often find that a similar formula is needed in several ad!acent cells. #or example, if you have a list of items and each item contributes to the total income for one year, you might want to add the items to total the income for that year. o total the income for consecutive years, you can create formulas to sum the income for each year. #ortunately, you can avoid entering formulas repeatedly and save a considerable amount of time by copying a cell with a completed function and pasting it into the destination cells. %ou can also use the #ill handle, which is the small s$uare in the bottom&right corner of the active cell.
When you select a cell with a formula and drag the #ill handle, Excel changes the cell references in the formula to match those of the column or row to which it has been copied. he reservations manager does not want to type the same formula over and over to calculate the occupancy rate for each type of room for each month. Instead, he copies his formulas to several locations.
IV-3.
For more information on the Paste Options button, see Lesson / @'diting and Formatting 4orksheets!A
3
%o op# a formula from the ell to the left of a sele ted ell, press Ctrl9;! %o op# a formula from the ell abo7e a sele ted ell, press Ctrl9=!
4hen #ou op# a formula to a different ell, '& el also opies the formatting to the other ell!
%he mouse pointer turns into a rosshair pointer when properl# positioned! =rag the Fill handle to ell ="! %he formula in ell C" is opied to ell =" and the $uto Fill Options button appears ne&t to the ell! " Cli k ell =", and obser7e its formula in the Formula bar! %he formula is opied from C", and the olumn letter is ad>usted to mat h the olumn of the new ell! Point to the Fill handle in ell =", and drag the handle to ell 3"! %he formula is opied to ells '"?3"! %he total numbers of nights o upied for ea h month are displa#ed in ells '"?3"!
Bou an use the Fill handle to op# te&t dire tl# from one ell or another, or #ou an use it to omplete a series of #ears, dates, da#s, and so on! Bou will learn more about Fill features later in this lesson!
&
0a7e the worksheet and lea7e it open for a later e&er ise!
IV-3."
Computer Fundamentals
Editing Formulas
Editing a formula that you have already created is easy and similar to editing the contents of any other cell. %ou can/
A =ouble- li k the ell, t#pe #our hanges dire tl# in the ell, and press 'nter! Or A Cli k the ell, li k in the Formula bar, t#pe #our hanges, and li k the 'nter button on the Formula bar!
If #ou inad7ertentl# delete or hange a formula, press Ctrl9C or li k the Undo button on the 0tandard toolbar to re7erse the a tion!
o delete a formula, click the cell and press the 7elete key. In this exercise, you revise and delete formulas.
1 2 Open the $ ti7it# ;entals workbook from the Part IV, Lesson03 folder in the Computer Fundamentals Pra ti e folder! Cli k ell O3, and li k to the right of the formula in the Formula bar! %he insertion point flashes at the end of the formula! Press the 8a kspa e ke# three times, then li k the 'nter button! %he pri e per rental, shown in ell O3, is deleted from the formula! %he re7ised formula al ulates total ka#ak rentals for the #ear! Cop# the formula to ells O:?O+2 b# using the Fill handle in ell O3! '& el al ulates and displa#s the total #earl# rentals per t#pe of e.uipment! Cli k ell O/, delete the e&isting te&t, t#pe (earl) *entals, and then press 'nter! %he new label repla es the old one!
" #
Cli k ell O+2, and press the =elete ke#! %he formula and the ell ontents are deleted from the ell! Close the workbook without sa7ing #our hanges!
IV-3.#
he reservations manager learns that "uto8um can make it even easier for him to complete his occupancy calculations. De can use "uto8um to calculate the many totals he needs. In this exercise, you use "uto8um to total a range of cells.
1 2 If ne essar#, swit h to the Lodging Usage workbook that #ou used earlier in this lesson! Cli k ell C+2, and li k the $uto0um button on the 0tandard toolbar! $ 0UD formula appears in ell C+2 and the Formula bar, and the range C+3?C+< is surrounded b# a flashing mar.uee border! Press 'nter! %he formula is entered in ell C+), and the result (,:!+,* is displa#ed! Cli k ell O,, and then li k $uto0um! $ 0UD formula is displa#ed in ell O, and in the Formula bar, and the range C,?3, is surrounded b# a flashing mar.uee border!
IV-3.&
Computer Fundamentals
Press 'nter! %he formula is entered in ell O,, and the result (/"0)* is displa#ed!
"
0a7e the workbook and lea7e it open for a later e&er ise!
IV-3.'
In the 0ele t a fun tion list, li k 0UD and then li k O6! %he Fun tion $rguments dialog bo& appears, showing the 0UD fun tion totaling ells C3?33!
In the Formula bar, li k to the right of the losing parenthesis, and t#pe +,3! %his formula totals the number of ka#ak rentals per #ear, and then it multiplies the total b# the ost per rental! " Cli k O6 in the Fun tion $rguments dialog bo&! %he Fun tion $rguments dialog bo& loses and the result of the in ome al ulation (+"",* appears in ell O3! Cli k ell $/0! %hen t#pe =CO-N./ and sele t ells $3?$+2! Cells $3 through $+2 appear as arguments in the COU3% fun tion! %#pe the losing 0 and press 'nter! '& el ounts +, numeri entries in ells 3 through +2 of olumn $! =elete the entr# in ell $/0, and sa7e the workbook! Lea7e the workbook open for a later lesson!
# & '
IV-3.11
Computer Fundamentals
# &
Cli k to the right of the fun tion in the Formula bar, and t#pe a minus sign (-*! On the Fun tions list to the left of the Formula bar, li k =ate! %he Fun tion $rguments dialog bo& opens!
IV-3.11
'
=ate fun tions are most useful when the date arguments are formulas, rather than onstants!
In the Bear, Donth, and =a# bo&es, t#pe the date 11%11%2113, and li k O6! %he total number of da#s (+/0* between ++E+E/003 and /E/"E/00: appears in the ell! %he formula reads? F=$%'(/000,/,/"* -=$%'(+""",++,+* In the Formula bar, li k the first =ate fun tion! $ 0 reen%ip appears with a des ription of ea h item in that portion of the formula! Cli k #ear in the 0 reen%ip to sele t the urrent number and t#pe 211 ! In the Formula bar, li k to the right of the formula! Press the 8a kspa e ke# +, times to remo7e the se ond date fun tion! %#pe .O2,(/0, and press 'nter! %he total number of da#s between /E/"E/00, and the urrent date appears in the ell! Close the workbook without sa7ing #our hanges!
11
11 12 13 1$
tip
%o .ui kl# al ulate the number of da#s between two dates that alread# appear in ells in #our worksheet, simpl# subtra t one ell from the other! For e&le, if ell $+ ontains the date ++E+E/003 and ell $/ ontains the date /E/"E/00:, the number of da#s between them an be al ulated with the following formula! =A2-A1 Dake sure to hoose the number format for the ell ontaining this formula! Otherwise, '& el displa#s the result in the same format as the ells used in the al ulation (in this ase, as a date*!
IV-3.12
Computer Fundamentals
.ell references are fre$uently used in formulas. By default, cell references are relative, even if the formula contains the row letter and column number of the target cell. #or example, if you enter 18(M0.;,.C2 in cell .<, the resulting value in .< will be .; 3 .C. If you copy this formula to cell 7<, the formula in 7< will appear as 18(M07;,7C2 and the resulting value in cell 7< will be 7; 3 7C. Excel automatically ad!usts the cell references relative to their new locationF thats why they are called GrelativeH cell references. In some cases, however, you need cell references that wont change when you copy them from one location to another. #or example, a formula might refer to a cell with a rate of interest that is always stored in a particular cell. Its also possible for a cell reference to have an absolute reference to a row but not to a column, and vice versa. o make a cell reference absolute, type a dollar sign 0I2 before either or both of the column or row references. #or example, I.I= is an absolute reference to cell .=. I.= is an absolute reference to column ., but the reference to row = is relative. .I= is a relative reference to column ., but the reference to row = is absolute.
tip
Using 3-2 references, #ou an link to ells in other worksheets or workbooks! %his t#pe of referen e an also be absolute or relati7e!
"t "dventure Works, the reservations manager is having trouble copying the formulas in his worksheet that calculate simple averages. (sing a combination of absolute and relative references, however, he is able to easily replicate the formulas to compute the necessary averages. In this exercise, you use absolute references and relative references to build and copy a formula.
1 2 3 Open the Lodging Usage workbook with whi h #ou worked earlier in this lesson! =ouble- li k ell C+3! %#pe a dollar sign (3* before the $ in the referen e to ell $,, and press 'nter! %he formula reads FC,EG$,! Cop# the formula in ell C+3 to ell =+3, and li k ell =+3 if ne essar# to sele t it!
IV-3.13
%he formula in ell =+3 reads F=,EG$,! 8e ause the olumn referen e to ell $, is absolute, that referen e does not hange when the formula is opied! %he referen e to the first ell in the formula is entirel# relati7e! Cop# the formula in ell C+3 to ell C+:, and li k ell C+:! %he formula in ell C+: reads FC<EG$<! 8e ause the referen e to olumn $ is absolute, that referen e does not hange when the formula is opied! Howe7er, the row referen e is still relati7e, so that 7alue is updated when the formula is opied! %he referen e to the first ell is entirel# relati7e! " Using Fill handles, op# the formula to omplete the $7erage 3umber of 3ights O upied Per ;oom table (C+3?3+<*!
Function
8um "verage
Meaning
otals the numeric arguments. .omputes the average 0arithmetic mean2 of the numeric arguments. Within the argument list, counts only the cells that contain numbers. )eturns the smallest number within the arguments. )eturns the largest number within the arguments.
Example
18(M0BC/B=,2 1"+E)"JE0BC/B=, 2 1.?(E 0BC/B=,2
.ount
Min Max
1MIE0BC/B=,2 1M"K0BC/B=,2
he activities manager at "dventure Works is learning which Excel functions might help her devise a strategy for activities in the next year. In this exercise, you create formulas using the "+E)"JE, MIE, and M"K functions.
IV-3.1$
Computer Fundamentals
1 2 3
In the $ ti7it# ;entals workbook, li k ell $/0, if ne essar#, and li k the Insert Fun tion button! Cli k $V';$I' in the 0ele t a fun tion list and then li k O6! In the 3umber + bo&, li k the Collapse =ialog button! %he Fun tion $rguments dialog bo& ollapses, allowing #ou to sele t the range of ells to be a7eraged! 0ele t ells C+,?3+,, and li k the '&pand =ialog button in the Fun tion $rguments dialog bo&! %he Fun tion $rguments dialog bo& appears with the ompleted $V';$I' fun tion!
In the Fun tion $rguments dialog bo&, li k O6! %he a7erage number of pairs of bino ulars rented per month (+<* appears in ell $/0! " # Cli k in the Formula bar and sele t the word $V';$I'! Cli k the Fun tions down arrow to the left of the Formula bar ( urrentl# displa#ing the te&t $V';$I'*, and li k D$J! %he Fun tion $rguments dialog bo& opens with the range pre7iousl# used alread# entered!
tip
If #ou forget the s#nta& for a fun tion #ou want to use, t#pe = and the name of the fun tion in a ell, and then press Ctrl9$! %he Fun tion $rguments dialog bo& appears so #ou an enter the arguments for #our fun tion!
IV-3.1
&
In the Fun tion $rguments dialog bo&, li k O6! %he highest number of pairs of bino ulars rented in a month (/,* appears in ell $//!
'
Cli k ell $/:, t#pe =4IN/C1 5N1 0, and then press 'nter! %he lowest number of pairs of bino ulars rented in a month ("* appears in ell $/:! =elete the entries in ells $/0 and $/:! 6eep this file open for the ne&t e&er ise!
11
Option
.opy .ells #ill 8eries #ill #ormatting ?nly
Action
.opy the contents of the selected cells to the cells indicated by the #ill operation. #ill the cells indicated by the #ill operation with the next items in the series. .opy the format of the selected cell to the cells indicated by the #ill operation, but do not place any values in the target cells. #ill the cells indicated by the #ill operation with the next items in the series, but ignore any formatting applied to the source cells. his option changes according to the series Excel detects and seems to have the same effect as the #ill 8eries option. If you do not use a recogniMed se$uence, the option does not appear.
#ill Nse$uenceO
IV-3.1"
Computer Fundamentals
tip
If the $uto Fill Options button doesn5t appear, #ou an turn the feature on b# li king Options on the %ools menu! In the dialog bo& that appears, li k the 'dit tab and then sele t the 0how Paste Options buttons he k bo&!
In the %#pe se tion, li k the $utoFill option, and li k O6! %he months of the #ear fill row +! " # & ' Cli k ell $/, t#pe 1st, and then press 'nter! %he insertion point mo7es to ell $3! %#pe 3r7, and press 'nter! 0ele t the range $/?$3, and drag the Fill handle down to ell $+2! Odd numbered da#s fill the olumn!
tip
'& el in ludes another timesa7ing feature alled $utoComplete! $utoComplete an finish te&t entries for #ou when #ou t#pe in a olumn! If the first few letters that #ou t#pe mat h a pre7ious entr# in the olumn, '& el ompletes the entr#! Bou an disable $utoComplete b# li king Options on the %ools menu, li king the 'dit tab, and learing the 'nable $utoComplete For Cell Values he k bo&!
IV-3.1#
%esson &rap'Up
In this lesson, you learned how to create, copy, and edit formulas. %ou also learned how to use "uto8um, the Insert function, 7ate functions, basic 8tatistical functions, and absolute and relative cell references. #inally, you learned how to use "uto#ill when working with numbered series. If you are continuing to other lessons/
A Close the $ ti7it# ;entals workbook and sa7e #our hanges!
(uic) (ui*
1 2 3 $ How an #ou enter a formula into a ellK 4hat is the .ui kest wa# to total a olumn of 7aluesK How an #ou op# a formula to a range of ad>a ent ellsK 4hat are two wa#s to edit a formula in a ellK
IV-3.1&
Computer Fundamentals
E8ercise 35 In this lesson we typed in the .?(E function. .an this function be entered through the Insert #unction dialog boxP If so, what category of functions does it belong toP )eview the other categories available from the Insert #unction dialog box. What category would you be likely to use the mostP E8ercise $5 In this lesson we illustrated how to find the number of days between two days by entering the dates in a formula that subtracted one date from the other. Is there a function that can do this automaticallyP Is there a way to calculate !ust the number of workdays between two dates 0not counting weekends2P Explore the 7ate Q ime category of the Insert #unction dialog box or use Excels Delp files to find the answers to these $uestions and write a brief summary of your findings. E8ercise 5 In this lesson we touched briefly on the new "uto #ill ?ptions button that appears whenever you fill cells. )eturn to the "ctivity )entals workbook and repeat the "uto#ill and 8eries steps but this time explore using the options available through the "uto #ill ?ptions button. Briefly describe how these options could be useful.