Upload
hutapeaapyn
View
29
Download
0
Embed Size (px)
DESCRIPTION
Excel
Citation preview
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
1/108
MicrosoftExcel
Functions,Macros&
DataCommands
J.CarltonCollins,CPA
ASAResearch
Atlanta,Georgia
770.734.0950
S R e s e a r c h
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
2/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page2 CopyrightMay2010
TableofContents
Chapter1ExcelFunctions..........................................................................4
Chapter2TheIfFunction.........................................................................18
Chapter3UsingFunctionstoClean&CrunchData.................................23
Chapter4DataCommands......................................................................41
Chapter5 Macros.....................................................................................76
Chapter6Miscellaneous .........................................................................81
Chapter7XMLData.................................................................................84
Chapter8QuickTips................................................................................92
Chapter9WhatsNewinExcel2007.......................................................95
Chapter10WhatsnewinExcel2010....................................................104
Appendix InstructorsBiography............................................................108
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
3/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page3 CopyrightMay2010
ExcelFunctions,Macros&DataCommandsCourseInformation
LearningObjectives ToincreasetheproductivityofaccountantsandCPAs
usingExcelsfunctions,macros,&datacommands
CourseLevel Intermediate
PreRequisites GoodFamiliaritywithMicrosoftExcel
AdvancedPreparation None
PresentationMethod Livelectureusingfullcolorprojectionsystemsand
liveInternetaccesswithfollowupcoursematerials
RecommendedCPECredit 8hours
Handouts Templates,checklists,webexamples,manual
Instructors J.CarltonCollins,CPA
AdvisorCPE isregisteredwiththeNationalAssociationof
State Boards of Accountancy (NASBA) as a sponsor of
continuingprofessional
education
on
the
National
Registry of CPE Sponsors. State boards of accountancy
have final authority on the acceptance of individual
coursesfor CPE credit. Complaints regarding registered
sponsors may be addressed to the national Registry of
CPE Sponsors,150 FourthAvenue,Nashville,TN,37219
2417.Telephone:6158804200.
Copyright May2010,AdvisorCPEandAccountingSoftwareAdvisor,LLC
4480MissendellLane,Norcross,Georgia30092770.734.0450
Allrightsreserved. Nopartofthispublicationmaybereproducedortransmittedinanyformwithouttheexpress
written
consent
of
AdvisorCPE
or
ASA
Research,
subsidiaries
of
Accounting
Software
Advisor,
LLC.
Request
may
be
emailed to [email protected] or further information can be obtained by calling 770.734.0450 or by
accessingtheAdvisorCPEhomepageat:http://www.advisorcpe.com/
Alltradenamesandtrademarksusedinthesematerialsarethepropertyoftheirrespectivemanufacturersand/or
owners. Theuseoftradenamesandtrademarksusedinthesematerialsarenotintendedtoconveyendorsement
of any other affiliations with these materials. Any abbreviations used herein are solely for the readers
convenience and arenot intended to compromise any trademarks. Someof the featuresdiscussedwithin this
manualapplyonlytocertainversionsofExcel,andfromtimetotime,Microsoftmightremovesomefunctionality.
Microsoft Excel is known to contain numerous software bugswhichmay prevent the successful use of some
features insomecases.AdvisorCPEmakesnorepresentationsorwarrantywithrespecttothecontentsofthese
materialsanddisclaimsanyimpliedwarrantiesofmerchantabilityoffitnessforanyparticularuse. Thecontentsof
thesematerialsaresubjecttochangewithoutnotice.
ContactInformation:
J.CarltonCollins
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
4/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page4 CopyrightMay2010
Chapter1
Excel
Functions
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
5/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page5 CopyrightMay2010
IntroductiontoExcelFunctions
ExcelFunctionsarepreprogrammedformulasthatmakethetaskofwritingcomplexformulas
easier. There are a total of 333 functions in Excel. These functions are separated into 11
categoriesasfollows:
Categories&NumberOfFunctionsInEachCategory
1. DatabaseFunctions(12)
2. DateandTimeFunctions(20)
3. EngineeringFunctions(39)
4. FinancialFunctions(53)
5. InformationFunctions(17)
6. LogicalFunctions(6)
7. LookupandReferenceFunctions(18)
8. MathandTrigonometryFunctions(59)
9. StatisticalFunctions(80)10.TextFunctions(27)
11.ExternalFunctions(2)
RelevancetoCPAs SomeExcelfunctionsaremorepowerfulthanothersandsomearemore
relevant to the CPA than others. For example, most CPAs will find the IF, SUM, COUNT,
SUBTOTAL, TEXT, and VLOOKUP are very relevant to the CPAwhile other engineering and
trigonometry functions suchas LOG,PI,RADIENS,DELTA,TAN,COMPLEX,andHAX2DECare
typically lessrelevanttoCPAs. Ithasbeenmyexperiencethatthefollowing75functionsare
mostrelevanttotheCPA;thereforeinmyopinion,CPAswishingtoincreasetheircommandof
Excelfunctionsshouldconcentrateonthesefunctionsfirst.
CarltonsListofTheTop75FunctionsMostRelevanttoCPAs(SortedByCarltonsOpinionofUsefulness)
OpenanExcelfileContainingFunctionExamples:
http://www.ASAResearch.com/web/functions.xlsx
1. IF Specifiesalogicaltesttoperform
2. SUM Addsitsarguments
3. SUBTOTAL Returnsasubtotalinalistordatabase
4. SUMIF Addsthecellsspecifiedbyagivencriteria
5. COUNT Countshowmanynumbersareinthelistofarguments
6. COUNTA Countshowmanyvaluesareinthelistofarguments
7. AVERAGE Returnstheaverageofarangeofnumbers
8. COUNTBLANK Countsthenumberofblankcellswithinarange
9. COUNTIF Countsthenumberofnonblankcellswithinarangethatmeetthegivencriteria
10.VALUE Convertstexttoanumber
11.TEXT Formatsanumberandconvertsittotext
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
6/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page6 CopyrightMay2010
12.VLOOKUP Looksinthefirstcolumnofanarrayandmovesacrosstherowtoreturnthevalueofacell
13.HLOOKUP Looksinthetoprowofanarrayandreturnsthevalueoftheindicatedcell
14.TWOWAYLOOKUPUsingbothVLOOKUPandHLOOKUPtogether
15.LOOKUP Looksupvaluesinavectororarray
16.MATCH Looksupvaluesinareferenceorarray
17.TRIM Removesspacesfromtext
18.PROPER Capitalizesthefirstletterineachwordofatextvalue
19.LOWER Convertstexttolowercase
20.UPPER Convertstexttouppercase
21.LEFT Returnstheleftmostcharactersfromatextvalue
22.RIGHT Returnstherightmostcharactersfromatextvalue
23.MID Returnsa specificnumberof characters froma text string startingat thepositionyouspecify
24.FIND Findsonetextvaluewithinanother(casesensitive)
25.SUBSTITUTE Substitutesnewtextforoldtextinatextstring
26.LEN Returnsthenumberofcharactersinatextstring27.REPLACE Replacestextinastringwithalternativetext
28.CONCATENATE Joinsseveraltextitemsintoonetextitem
29.CLEAN Removesallnonprintablecharactersfromtext
30.NOW Returnstheserialnumberofthecurrentdateandtime
31.TODAY Returnstheserialnumberoftoday'sdate
32.DATE Returnstheserialnumberofaparticulardate
33.MONTH Convertsaserialnumbertoamonth
34.DAY Convertsaserialnumbertoadayofthemonth
35.YEAR Convertsaserialnumbertoayear
36.WEEKDAY Convertsaserialnumbertoadayoftheweek
37.ROUND Roundsanumbertoaspecifiednumberofdigits
38.ROUNDDOWN Roundsanumberdown,towardzero
39.ROUNDUP Roundsanumberup,awayfromzero
40.MAX Returnsthemaximumvalueinalistofarguments
41.DMAX Returnsthemaximumvaluefromatablearraybasedonalistofarguments
42.MIN Returnstheminimumvalueinalistofarguments
43.DMIN Returnstheminimumvaluefromatablearraybasedonalistofarguments
44.MEDIAN Returnsthemedianofthegivennumbers
45.MODE Returnsthemostcommonvalueinadataset
46.PERCENTILE Returnsthekthpercentileofvaluesinarange
47.PERCENTRANK Returnsthepercentagerankofavalueinadataset48.PMT Returnstheperiodicpaymentforanannuity
49.NPV Returnsthenetpresentvalueofaninvestmentbasedonaseriesofperiodiccashflowsandadiscountrate
50.DSUM Addsthenumbersinthefieldcolumnofrecordsinthedatabasethatmatchthecriteria
51.DCOUNT Countsthecellsthatcontainnumbersinadatabase
52.DCOUNTA Countsnonblankcellsinadatabase
53.AND ReturnsTRUEifallofitsargumentsareTRUE
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
7/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page7 CopyrightMay2010
54.OR ReturnsTRUEifanyargumentisTRUE
55.CHOOSE Choosesavaluefromalistofvalues
56.TIME Returnstheserialnumberofaparticulartime
57.FV Returnsthefuturevalueofaninvestment
58.IRR Returnstheinternalrateofreturnforaseriesofcashflows
59.YIELD Returnstheyieldonasecuritythatpaysperiodicinterest60.CELL Returnsinformationabouttheformatting,location,orcontentsofacell
61.INFO Returnsinformationaboutthecurrentoperatingenvironment
62.ERROR.TYPE Returnsanumbercorrespondingtoanerrortype
63.ISBLANK ReturnsTRUEifthevalueisblank
64.ISNA ReturnsTRUEifthevalueisthe#N/Aerrorvalue
65.GETPIVOTDATA ReturnsdatastoredinaPivotTable
66.HYPERLINK Createsashortcutorjumpthatopensadocumentstoredonanetworkserver,anintranet,ortheInternet
67.TRANSPOSE Returnsthetransposeofanarray
68.ABS Returnstheabsolutevalueofanumber
69.RAND Returnsarandomnumberbetween0and1
70.RANDBETWEEN Returnsarandomnumberbetweenthenumbersyouspecify
71.REPT Repeatstextagivennumberoftimes
72.SLN Returnsthestraightlinedepreciationofanassetforoneperiod
73.SYD Returnsthesumofyears'digitsdepreciationofanassetforaspecifiedperiod
74.DDB Returnsthedoubledecliningbalancedepreciationofanassetforaspecifiedperiod
75.DGET Extractsfromadatabaseasinglerecordthatmatchesthespecifiedcriteria
'J.CarltonCollins,CPA Copyright,January2007,[email protected]
All333ExcelFunctions
OrganizedBy
Category,
Including
A
Description
Of
Each
Function
DatabaseFunctions
Function Description
1 DAVERAGE Returnstheaverageofselecteddatabaseentries
2 DCOUNT Countsthecellsthatcontainnumbersinadatabase
3 DCOUNTA Countsnonblankcellsinadatabase
4 DGET Extractsfromadatabaseasinglerecordthatmatchesthespecifiedcriteria
5 DMAX Returnsthemaximumvaluefromselecteddatabaseentries
6 DMIN Returnstheminimumvaluefromselecteddatabaseentries
7 DPRODUCT Multipliesthevaluesinaparticularfieldofrecordsthatmatchthecriteriain
adatabase
8 DSTDEV Estimatesthestandarddeviationbasedonasampleofselecteddatabase
entries
9 DSTDEVP Calculatesthestandarddeviationbasedontheentirepopulationofselected
databaseentries
10 DSUM Addsthenumbersinthefieldcolumnofrecordsinthedatabasethatmatch
thecriteria
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
8/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page8 CopyrightMay2010
11 DVAR Estimatesvariancebasedonasamplefromselecteddatabaseentries
12 DVARP Calculatesvariancebasedontheentirepopulationofselecteddatabase
entries
DateandTimeFunctions
Function Description
13 DATE Returnstheserialnumberofaparticulardate
14 DATEVALUE Convertsadateintheformoftexttoaserialnumber
15 DAY Convertsaserialnumbertoadayofthemonth
16 DAYS360 Calculatesthenumberofdaysbetweentwodatesbasedona360dayyear
17 EDATE Returnstheserialnumberofthedatethatistheindicatednumberofmonths
beforeorafterthestartdate
18 EOMONTH Returnstheserialnumberofthelastdayofthemonthbeforeoraftera
specifiednumberofmonths
19 HOUR Convertsaserialnumbertoanhour
20 MINUTE Convertsaserialnumbertoaminute
21 MONTH Convertsaserialnumbertoamonth
22 NETWORKDAYS Returnsthenumberofwholeworkdaysbetweentwodates
23 NOW Returnstheserialnumberofthecurrentdateandtime
24 SECOND Convertsaserialnumbertoasecond
25 TIME Returnstheserialnumberofaparticulartime
26 TIMEVALUE Convertsatimeintheformoftexttoaserialnumber
27 TODAY Returnstheserialnumberoftoday'sdate
28 WEEKDAY Convertsaserialnumbertoadayoftheweek
29
WEEKNUM
Converts
a
serial
number
to
a
number
representing
where
the
week
falls
numericallywithayear
30 WORKDAY Returnstheserialnumberofthedatebeforeorafteraspecifiednumberof
workdays
31 YEAR Convertsaserialnumbertoayear
32 YEARFRAC Returnstheyearfractionrepresentingthenumberofwholedaysbetween
start_dateandend_date
EngineeringFunctions
Function Description
33 BESSELI ReturnsthemodifiedBesselFunctionIn(x)
34 BESSELJ ReturnstheBesselFunctionJn(x)
35 BESSELK ReturnsthemodifiedBesselFunctionKn(x)
36 BESSELY ReturnstheBesselFunctionYn(x)
37 BIN2DEC Convertsabinarynumbertodecimal
38 BIN2HEX Convertsabinarynumbertohexadecimal
39 BIN2OCT Convertsabinarynumbertooctal
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
9/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page9 CopyrightMay2010
40 COMPLEX Convertsrealandimaginarycoefficientsintoacomplexnumber
41 CONVERT Convertsanumberfromonemeasurementsystemtoanother
42 DEC2BIN Convertsadecimalnumbertobinary
43 DEC2HEX Convertsadecimalnumbertohexadecimal
44 DEC2OCT Convertsadecimalnumbertooctal
45 DELTA Testswhethertwovaluesareequal
46 ERF ReturnstheerrorFunction
47 ERFC ReturnsthecomplementaryerrorFunction
48 GESTEP Testswhetheranumberisgreaterthanathresholdvalue
49 HEX2BIN Convertsahexadecimalnumbertobinary
50 HEX2DEC Convertsahexadecimalnumbertodecimal
51 HEX2OCT Convertsahexadecimalnumbertooctal
52 IMABS Returnstheabsolutevalue(modulus)ofacomplexnumber
53 IMAGINARY Returnstheimaginarycoefficientofacomplexnumber
54 IMARGUMENT Returnstheargumenttheta,anangleexpressedinradians
55 IMCONJUGATE Returnsthecomplexconjugateofacomplexnumber
56 IMCOS Returnsthecosineofacomplexnumber
57 IMDIV Returnsthequotientoftwocomplexnumbers
58 IMEXP Returnstheexponentialofacomplexnumber
59 IMLN Returnsthenaturallogarithmofacomplexnumber
60 IMLOG10 Returnsthebase10logarithmofacomplexnumber
61 IMLOG2 Returnsthebase2logarithmofacomplexnumber
62 IMPOWER Returnsacomplexnumberraisedtoanintegerpower
63
IMPRODUCT
Returns
the
product
of
from
2
to
29
complex
numbers
64 IMREAL Returnstherealcoefficientofacomplexnumber
65 IMSIN Returnsthesineofacomplexnumber
66 IMSQRT Returnsthesquarerootofacomplexnumber
67 IMSUB Returnsthedifferencebetweentwocomplexnumbers
68 IMSUM Returnsthesumofcomplexnumbers
69 OCT2BIN Convertsanoctalnumbertobinary
70 OCT2DEC Convertsanoctalnumbertodecimal
71 OCT2HEX Convertsanoctalnumbertohexadecimal
FinancialFunctions
Function Description
72 ACCRINT Returnstheaccruedinterestforasecuritythatpaysperiodicinterest
73 ACCRINTM Returnstheaccruedinterestforasecuritythatpaysinterestatmaturity
74 AMORDEGRC Returnsthedepreciationforeachaccountingperiodbyusingadepreciation
coefficient
75 AMORLINC Returnsthedepreciationforeachaccountingperiod
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
10/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page10 CopyrightMay2010
76 COUPDAYBS Returnsthenumberofdaysfromthebeginningofthecouponperiodtothe
settlementdate
77 COUPDAYS Returnsthenumberofdaysinthecouponperiodthatcontainsthe
settlementdate
78 COUPDAYSNC Returnsthenumberofdaysfromthesettlementdatetothenextcoupon
date
79 COUPNCD Returnsthenextcoupondateafterthesettlementdate
80 COUPNUM Returnsthenumberofcouponspayablebetweenthesettlementdateand
maturitydate
81 COUPPCD Returnsthepreviouscoupondatebeforethesettlementdate
82 CUMIPMT Returnsthecumulativeinterestpaidbetweentwoperiods
83 CUMPRINC Returnsthecumulativeprincipalpaidonaloanbetweentwoperiods
84 DB Returnsthedepreciationofanassetforaspecifiedperiodbyusingthefixed
decliningbalancemethod
85 DDB Returnsthedepreciationofanassetforaspecifiedperiodbyusingthe
doubledecliningbalancemethodorsomeothermethodthatyouspecify
86 DISC Returnsthediscountrateforasecurity
87 DOLLARDE Convertsadollarprice,expressedasafraction,intoadollarprice,expressed
asadecimalnumber
88 DOLLARFR Convertsadollarprice,expressedasadecimalnumber,intoadollarprice,
expressedasafraction
89 DURATION Returnstheannualdurationofasecuritywithperiodicinterestpayments
90 EFFECT Returnstheeffectiveannualinterestrate
91 FV Returnsthefuturevalueofaninvestment
92 FVSCHEDULE Returnsthefuturevalueofaninitialprincipalafterapplyingaseriesof
compoundinterestrates
93 INTRATE Returnstheinterestrateforafullyinvestedsecurity94 IPMT Returnstheinterestpaymentforaninvestmentforagivenperiod
95 IRR Returnstheinternalrateofreturnforaseriesofcashflows
96 ISPMT Calculatestheinterestpaidduringaspecificperiodofaninvestment
97 MDURATION ReturnstheMacauleymodifieddurationforasecuritywithanassumedpar
valueof$100
98 MIRR Returnstheinternalrateofreturnwherepositiveandnegativecashflowsare
financedatdifferentrates
99 NOMINAL Returnstheannualnominalinterestrate
100 NPER Returnsthenumberofperiodsforaninvestment
101 NPV Returnsthenetpresentvalueofaninvestmentbasedonaseriesofperiodiccashflowsandadiscountrate
102 ODDFPRICE Returnsthepriceper$100facevalueofasecuritywithanoddfirstperiod
103 ODDFYIELD Returnstheyieldofasecuritywithanoddfirstperiod
104 ODDLPRICE Returnsthepriceper$100facevalueofasecuritywithanoddlastperiod
105 ODDLYIELD Returnstheyieldofasecuritywithanoddlastperiod
106 PMT Returnstheperiodicpaymentforanannuity
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
11/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page11 CopyrightMay2010
107 PPMT Returnsthepaymentontheprincipalforaninvestmentforagivenperiod
108 PRICE Returnsthepriceper$100facevalueofasecuritythatpaysperiodicinterest
109 PRICEDISC Returnsthepriceper$100facevalueofadiscountedsecurity
110 PRICEMAT Returnsthepriceper$100facevalueofasecuritythatpaysinterestat
maturity
111 PV Returnsthepresentvalueofaninvestment
112 RATE Returnstheinterestrateperperiodofanannuity
113 RECEIVED Returnstheamountreceivedatmaturityforafullyinvestedsecurity
114 SLN Returnsthestraightlinedepreciationofanassetforoneperiod
115 SYD Returnsthesumofyears'digitsdepreciationofanassetforaspecified
period
116 TBILLEQ ReturnsthebondequivalentyieldforaTreasurybill
117 TBILLPRICE Returnsthepriceper$100facevalueforaTreasurybill
118 TBILLYIELD ReturnstheyieldforaTreasurybill
119 VDB Returnsthedepreciationofanassetforaspecifiedorpartialperiodbyusing
adecliningbalancemethod
120 XIRR Returnstheinternalrateofreturnforascheduleofcashflowsthatisnot
necessarilyperiodic
121 XNPV Returnsthenetpresentvalueforascheduleofcashflowsthatisnot
necessarilyperiodic
122 YIELD Returnstheyieldonasecuritythatpaysperiodicinterest
123 YIELDDISC Returnstheannualyieldforadiscountedsecurity;forexample,aTreasurybill
124 YIELDMAT Returnstheannualyieldofasecuritythatpaysinterestatmaturity
InformationFunctions
Function Description
125 CELL Returnsinformationabouttheformatting,location,orcontentsofacell
126 ERROR.TYPE Returnsanumbercorrespondingtoanerrortype
127 INFO Returnsinformationaboutthecurrentoperatingenvironment
128 ISBLANK ReturnsTRUEifthevalueisblank
129 ISERR ReturnsTRUEifthevalueisanyerrorvalueexcept#N/A
130 ISERROR ReturnsTRUEifthevalueisanyerrorvalue
131 ISEVEN ReturnsTRUEifthenumberiseven
132 ISLOGICAL ReturnsTRUEifthevalueisalogicalvalue
133ISNA
Returns
TRUE
if
the
value
is
the
#N/A
error
value134 ISNONTEXT ReturnsTRUEifthevalueisnottext
135 ISNUMBER ReturnsTRUEifthevalueisanumber
136 ISODD ReturnsTRUEifthenumberisodd
137 ISREF ReturnsTRUEifthevalueisareference
138 ISTEXT ReturnsTRUEifthevalueistext
139 N Returnsavalueconvertedtoanumber
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
12/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page12 CopyrightMay2010
140 NA Returnstheerrorvalue#N/A
141 TYPE Returnsanumberindicatingthedatatypeofavalue
17
LogicalFunctions
Function Description
142 AND ReturnsTRUEifallofitsargumentsareTRUE
143 FALSE ReturnsthelogicalvalueFALSE
144 IF Specifiesalogicaltesttoperform
145 NOT Reversesthelogicofitsargument
146 OR ReturnsTRUEifanyargumentisTRUE
147 TRUE ReturnsthelogicalvalueTRUE
LookupandReferenceFunctions
Function Description
148 ADDRESS Returnsareferenceastexttoasinglecellinaworksheet
149 AREAS Returnsthenumberofareasinareference
150 CHOOSE Choosesavaluefromalistofvalues
151 COLUMN Returnsthecolumnnumberofareference
152 COLUMNS Returnsthenumberofcolumnsinareference
153 GETPIVOTDATA ReturnsdatastoredinaPivotTable
154 HLOOKUP Looksinthetoprowofanarrayandreturnsthevalueoftheindicatedcell
155 HYPERLINK Createsashortcutorjumpthatopensadocumentstoredonanetwork
server,anintranet,ortheInternet
156 INDEX Usesanindextochooseavaluefromareferenceorarray
157 INDIRECT Returnsareferenceindicatedbyatextvalue
158 LOOKUP Looksupvaluesinavectororarray
159 MATCH Looksupvaluesinareferenceorarray
160 OFFSET Returnsareferenceoffsetfromagivenreference
161 ROW Returnstherownumberofareference
162 ROWS Returnsthenumberofrowsinareference
163 RTD RetrievesrealtimedatafromaprogramthatsupportsCOM
automation(Automation:Awaytoworkwithanapplication'sobjectsfrom
anotherapplicationordevelopmenttool.FormerlycalledOLEAutomation,
AutomationisanindustrystandardandafeatureoftheComponentObject
Model(COM).)
164 TRANSPOSE Returnsthetransposeofanarray
165 VLOOKUP Looksinthefirstcolumnofanarrayandmovesacrosstherowtoreturnthe
valueofacell
MathandTrigonometryFunctions
Function Description
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
13/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page13 CopyrightMay2010
166 ABS Returnstheabsolutevalueofanumber
167 ACOS Returnsthearccosineofanumber
168 ACOSH Returnstheinversehyperboliccosineofanumber
169 ASIN Returnsthearcsineofanumber
170 ASINH Returnstheinversehyperbolicsineofanumber
171 ATAN Returnsthearctangentofanumber
172 ATAN2 Returnsthearctangentfromx andycoordinates
173 ATANH Returnstheinversehyperbolictangentofanumber
174 CEILING Roundsanumbertothenearestintegerortothenearestmultipleof
significance
175 COMBIN Returnsthenumberofcombinationsforagivennumberofobjects
176 COS Returnsthecosineofanumber
177 COSH Returnsthehyperboliccosineofanumber
178 DEGREES Convertsradianstodegrees
179EVEN
Rounds
anumber
up
to
the
nearest
even
integer
180 EXP Returnseraisedtothepowerofagivennumber
181 FACT Returnsthefactorialofanumber
182 FACTDOUBLE Returnsthedoublefactorialofanumber
183 FLOOR Roundsanumberdown,towardzero
184 GCD Returnsthegreatestcommondivisor
185 INT Roundsanumberdowntothenearestinteger
186 LCM Returnstheleastcommonmultiple
187 LN Returnsthenaturallogarithmofanumber
188 LOG Returnsthelogarithmofanumbertoaspecifiedbase
189 LOG10 Returnsthebase10logarithmofanumber
190 MDETERM Returnsthematrixdeterminantofanarray
191 MINVERSE Returnsthematrixinverseofanarray
192 MMULT Returnsthematrixproductoftwoarrays
193 MOD Returnstheremainderfromdivision
194 MROUND Returnsanumberroundedtothedesiredmultiple
195 MULTINOMIAL Returnsthemultinomialofasetofnumbers
196 ODD Roundsanumberuptothenearestoddinteger
197 PI Returnsthevalueofpi
198 POWER Returnstheresultofanumberraisedtoapower199 PRODUCT Multipliesitsarguments
200 QUOTIENT Returnstheintegerportionofadivision
201 RADIANS Convertsdegreestoradians
202 RAND Returnsarandomnumberbetween0and1
203 RANDBETWEEN Returnsarandomnumberbetweenthenumbersyouspecify
204 ROMAN Convertsanarabicnumeraltoroman,astext
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
14/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page14 CopyrightMay2010
205 ROUND Roundsanumbertoaspecifiednumberofdigits
206 ROUNDDOWN Roundsanumberdown,towardzero
207 ROUNDUP Roundsanumberup,awayfromzero
208 SERIESSUM Returnsthesumofapowerseriesbasedontheformula
209 SIGN Returnsthesignofanumber
210 SIN Returnsthesineofthegivenangle
211 SINH Returnsthehyperbolicsineofanumber
212 SQRT Returnsapositivesquareroot
213 SQRTPI Returnsthesquarerootof(number*pi)
214 SUBTOTAL Returnsasubtotalinalistordatabase
215 SUM Addsitsarguments
216 SUMIF Addsthecellsspecifiedbyagivencriteria
217 SUMPRODUCT Returnsthesumoftheproductsofcorrespondingarraycomponents
218 SUMSQ Returnsthesumofthesquaresofthearguments
219 SUMX2MY2 Returnsthesumofthedifferenceofsquaresofcorrespondingvaluesintwoarrays
220 SUMX2PY2 Returnsthesumofthesumofsquaresofcorrespondingvaluesintwoarrays
221 SUMXMY2 Returnsthesumofsquaresofdifferencesofcorrespondingvaluesintwo
arrays
222 TAN Returnsthetangentofanumber
223 TANH Returnsthehyperbolictangentofanumber
224 TRUNC Truncatesanumbertoaninteger
StatisticalFunctions
Function Description
225 AVEDEV Returnstheaverageoftheabsolutedeviationsofdatapointsfromtheir
mean
226 AVERAGE Returnstheaverageofitsarguments
227 AVERAGEA Returnstheaverageofitsarguments,includingnumbers,text,andlogical
values
228 BETADIST ReturnsthebetacumulativedistributionFunction
229 BETAINV ReturnstheinverseofthecumulativedistributionFunctionforaspecified
betadistribution
230 BINOMDIST Returnstheindividualtermbinomialdistributionprobability
231CHIDIST
Returns
the
one
tailed
probability
of
the
chi
squared
distribution
232 CHIINV Returnstheinverseoftheonetailedprobabilityofthechisquared
distribution
233 CHITEST Returnsthetestforindependence
234 CONFIDENCE Returnstheconfidenceintervalforapopulationmean
235 CORREL Returnsthecorrelationcoefficientbetweentwodatasets
236 COUNT Countshowmanynumbersareinthelistofarguments
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
15/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page15 CopyrightMay2010
237 COUNTA Countshowmanyvaluesareinthelistofarguments
238 COUNTBLANK Countsthenumberofblankcellswithinarange
239 COUNTIF Countsthenumberofnonblankcellswithinarangethatmeetthegiven
criteria
240 COVAR Returnscovariance,theaverageoftheproductsofpaireddeviations
241 CRITBINOM Returnsthesmallestvalueforwhichthecumulativebinomialdistributionislessthanorequaltoacriterionvalue
242 DEVSQ Returnsthesumofsquaresofdeviations
243 EXPONDIST Returnstheexponentialdistribution
244 FDIST ReturnstheFprobabilitydistribution
245 FINV ReturnstheinverseoftheFprobabilitydistribution
246 FISHER ReturnstheFishertransformation
247 FISHERINV ReturnstheinverseoftheFishertransformation
248 FORECAST Returnsavaluealongalineartrend
249 FREQUENCY Returnsafrequencydistributionasaverticalarray
250 FTEST ReturnstheresultofanFtest
251 GAMMADIST Returnsthegammadistribution
252 GAMMAINV Returnstheinverseofthegammacumulativedistribution
253 GAMMALN ReturnsthenaturallogarithmofthegammaFunction,(x)
254 GEOMEAN Returnsthegeometricmean
255 GROWTH Returnsvaluesalonganexponentialtrend
256 HARMEAN Returnstheharmonicmean
257 HYPGEOMDIST Returnsthehypergeometricdistribution
258 INTERCEPT Returnstheinterceptofthelinearregressionline
259 KURT Returnsthekurtosisofadataset260 LARGE Returnsthekthlargestvalueinadataset
261 LINEST Returnstheparametersofalineartrend
262 LOGEST Returnstheparametersofanexponentialtrend
263 LOGINV Returnstheinverseofthelognormaldistribution
264 LOGNORMDIST Returnsthecumulativelognormaldistribution
265 MAX Returnsthemaximumvalueinalistofarguments
266 MAXA Returnsthemaximumvalueinalistofarguments,includingnumbers,text,
andlogicalvalues
267 MEDIAN Returnsthemedianofthegivennumbers
268 MIN Returnstheminimumvalueinalistofarguments
269 MINA Returnsthesmallestvalueinalistofarguments,includingnumbers,text,and
logicalvalues
270 MODE Returnsthemostcommonvalueinadataset
271 NEGBINOMDIST Returnsthenegativebinomialdistribution
272 NORMDIST Returnsthenormalcumulativedistribution
273 NORMINV Returnstheinverseofthenormalcumulativedistribution
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
16/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page16 CopyrightMay2010
274 NORMSDIST Returnsthestandardnormalcumulativedistribution
275 NORMSINV Returnstheinverseofthestandardnormalcumulativedistribution
276 PEARSON ReturnsthePearsonproductmomentcorrelationcoefficient
277 PERCENTILE Returnsthekthpercentileofvaluesinarange
278 PERCENTRANK Returnsthepercentagerankofavalueinadataset
279 PERMUT Returnsthenumberofpermutationsforagivennumberofobjects
280 POISSON ReturnsthePoissondistribution
281 PROB Returnstheprobabilitythatvaluesinarangearebetweentwolimits
282 QUARTILE Returnsthequartileofadataset
283 RANK Returnstherankofanumberinalistofnumbers
284 RSQ ReturnsthesquareofthePearsonproductmomentcorrelationcoefficient
285 SKEW Returnstheskewnessofadistribution
286 SLOPE Returnstheslopeofthelinearregressionline
287 SMALL Returnsthekthsmallestvalueinadataset
288 STANDARDIZE Returnsanormalizedvalue
289 STDEV Estimatesstandarddeviationbasedonasample
290 STDEVA Estimatesstandarddeviationbasedonasample,includingnumbers,text,and
logicalvalues
291 STDEVP Calculatesstandarddeviationbasedontheentirepopulation
292 STDEVPA Calculatesstandarddeviationbasedontheentirepopulation,including
numbers,text,andlogicalvalues
293 STEYX Returnsthestandarderrorofthepredictedyvalueforeachxinthe
regression
294 TDIST ReturnstheStudent'stdistribution
295TINV
Returns
the
inverse
of
the
Student's
t
distribution296 TREND Returnsvaluesalongalineartrend
297 TRIMMEAN Returnsthemeanoftheinteriorofadataset
298 TTEST ReturnstheprobabilityassociatedwithaStudent'sttest
299 VAR Estimatesvariancebasedonasample
300 VARA Estimatesvariancebasedonasample,includingnumbers,text,andlogical
values
301 VARP Calculatesvariancebasedontheentirepopulation
302 VARPA Calculatesvariancebasedontheentirepopulation,includingnumbers,text,
andlogicalvalues
303WEIBULL
Returns
the
Weibull
distribution304 ZTEST Returnstheonetailedprobabilityvalueofaztest
TextFunctions
Function Description
305 ASC Changesfullwidth(doublebyte)Englishlettersorkatakanawithina
characterstringtohalfwidth(singlebyte)characters
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
17/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page17 CopyrightMay2010
306 BAHTTEXT Convertsanumbertotext,usingthe(baht)currencyformat
307 CHAR Returnsthecharacterspecifiedbythecodenumber
308 CLEAN Removesallnonprintablecharactersfromtext
309 CODE Returnsanumericcodeforthefirstcharacterinatextstring
310 CONCATENATE Joinsseveraltextitemsintoonetextitem
311 DOLLAR Convertsanumbertotext,usingthe$(dollar)currencyformat
312 EXACT Checkstoseeiftwotextvaluesareidentical
313 FIND,FINDB Findsonetextvaluewithinanother(casesensitive)
314 FIXED Formatsanumberastextwithafixednumberofdecimals
315 JIS Changeshalfwidth(singlebyte)Englishlettersorkatakanawithinacharacter
stringtofullwidth(doublebyte)characters
316 LEFT,LEFTB Returnstheleftmostcharactersfromatextvalue
317 LEN,LENB Returnsthenumberofcharactersinatextstring
318 LOWER Convertstexttolowercase
319MID,
MIDB
Returns
aspecific
number
of
characters
from
atext
string
starting
at
the
positionyouspecify
320 PHONETIC Extractsthephonetic(furigana)charactersfromatextstring
321 PROPER Capitalizesthefirstletterineachwordofatextvalue
322 REPLACE,
REPLACEB
Replacescharacterswithintext
323 REPT Repeatstextagivennumberoftimes
324 RIGHT,RIGHTB Returnstherightmostcharactersfromatextvalue
325 SEARCH,
SEARCHB
Findsonetextvaluewithinanother(notcasesensitive)
326 SUBSTITUTE Substitutesnewtextforoldtextinatextstring
327 T Convertsitsargumentstotext
328 TEXT Formatsanumberandconvertsittotext
329 TRIM Removesspacesfromtext
330 UPPER Convertstexttouppercase
331 VALUE Convertsatextargumenttoanumber
ExternalFunctions
Function Description
332 EUROCONVERT Convertsanumbertoeuros,convertsanumberfromeurostoaeuro
membercurrency,orconvertsanumberfromoneeuromembercurrencytoanotherbyusingtheeuroasanintermediary(triangulation)
333 SQL.REQUEST Connectswithanexternaldatasourceandrunsaqueryfromaworksheet,
thenreturnstheresultasanarraywithouttheneedformacroprogramming
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
18/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page18 CopyrightMay2010
Chapter2
The=IFFunction
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
19/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page19 CopyrightMay2010
=IF
The IF function is the most powerful of all functions not just in Excel, but in any
programming language. Commonly referred to as Conditional Programming, it is the IF
function thatenablesus to introduce logical thinking intoanyprogram.This function isalso
referredtoastheIfThenElsecommand,conditionalexpressions,orPropositionalLogic.
ThefollowingWikisexplainsthisconceptinmoredetail:
http://en.wikipedia.org/wiki/Conditional_(programming).
http://en.wikipedia.org/wiki/Logical_conditional#Conditional_statements
ThecleverCPAcanusetheIFFunctiontobuildelaborateExceltemplatesandfinancialmodels
containing an almostunlimited amount of sophisticated programming.Presentedbelow are
severalexamplestohelpyoubetterunderstandtheapplicationofthispowerfultool.
SimpleIF
TheIFfunctionreturnsonevalueifaconditionyouspecifyevaluatestoTRUE,and
anothervalueifthatconditionevaluatestoFALSE.Presentedbelowisasimpleexample:
SimpleIFwithCalculationPresentedbelowisanexamplethatisalittlemorecomplex:
SimpleIFLargerExamplePresentedbelowisyetanotherIFexampleonalittlelargerscale
this example shows how onemight apply the IF function to evaluate budget versus actual
comparisons.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
20/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page20 CopyrightMay2010
SimpleIFwithDropDown Inthefollowingexample,theIFfunctionischeckingtoseeifthey
havesignedupforinsurance. Iftheyhave,thedeductionamountisentered.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
21/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page21 CopyrightMay2010
Simple IFwith Calculation The next IF function example is determining each employees
earnedvacationdays. Iftheyhaveworkedformorethanayear,theyhaveearned5vacation
daysplusonedayforeachadditionalfullyear.
NestedIFFunctions Inthissample,therearefourpossibilitiesforbonuses.
IFFunctionwithLogicalORArgument TeamsAandCmeetonTuesday,TeamsBandDmeet
onThursday.WewanttolistthemeetingdaysincolumnD.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
22/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page22 CopyrightMay2010
More Complex IF Function Example The following IF example shows a more complex
application inwhich the user selects a taxpayer status from a drop down list,which then
retrievesthecorrecttaxbase,threshold,andincrementaltaxratestobeusedincalculatingtax.
This example illustrates how a CPA might prepare an income statement template that
calculates the appropriate amountof taxesasnet income and the taxpayer status changes.Essentiallythetemplatecalculatesthecorrecttaxgivenallfourpossibletaxpayerstatuses,and
theIFstatementsareusedtoselectthecorrectanswersbasedonthetaxpayerstatusselected.
Keepinmindthatdespitethemanyaccoladesmentionedabove,theIFFunctionisnotalways
thebestsolution.Forexample,theVLOOKUPwouldbeabetterandeasierfunctiontouseto
extractdatafromalistasshowninthenestedIFFunctionafewexamplesabove.ManyExcelFunctionsalsoprovidebuiltinIFThenElsefunctionality.
KeyPointersforUsingtheIFFunction:
1. NestingYoucanembedupto8nestedIFfunctionsinasingleformulainExcel2003,andupto
64IFnestedfunctionsinExcel2007.
2. AND,ORYoucanusetheANDand/orORoperatortoaddmoreconditionstoanIFFunction.
3. Variations of IF Excel offers several variations of the IF function as follows: COUNTIF,
COUNTIFS,SUMIF,SUMIFS.
4. Evaluatingan IFErrorSincethe IFstatementprovidesonlyatrueorfalseresult,there isno
waytoevaluateanIFFunctiontoERROR.Ifyoureceiveanerror,youwrotetheformulawrong.5. TheNullSet TheDoubleQuotes is theNull Set,orabsenceofa value. Forexample,when
testingforaZerobalanceortestingforablankcell,thefollowingIFfunctionswouldapply:
a. =IF(A1=0,ZERO,)
b. =IF(A1=,Blank,)
(ExcelalsoprovidesanISBLANKFunctionthatwouldalsowork.)
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
23/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page23 CopyrightMay2010
Chapter3
UsingFunctionsTo
Crunch&CleanData
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
24/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page24 CopyrightMay2010
CleaningDataUsingFunctions
CPAsoftenreceiveorretrievedatafrommanysourcesinawidevarietyofformatssuchasText
orCSVformats.Youdon'talwayshavecontrolovertheformatandtypeofdatathatyouimport
from anexternaldata source, suchas adatabase, text file,or aWebpage.Before you can
analyzethedata,youoftenneedtocleanitup.Fortunately,OfficeExcelhasmanyfeaturesto
helpyougetdata inthepreciseformatthatyouwant.Sometimes,thetaskisstraightforward
andthereisaspecificfeaturethatdoesthejobforyou.
Forexample,youcaneasilyuseSpellChecker tocleanupmisspelledwords incolumns that
containcommentsordescriptions.Or,ifyouwanttoremoveduplicaterows,youcanquicklydo
thisbyusingtheRemoveDuplicatesdialogbox.Atothertimes,youmayneedtomanipulate
oneormorecolumnsbyusingaformulatoconverttheimportedvaluesintonewvalues.
Forexample,ifyouwanttoremovetrailingspaces,youcancreateanewcolumntocleanthe
databyusingaformula,fillingdownthenewcolumn,convertingthatnewcolumn'sformulastovalues,andthen removingtheoriginalcolumn.Excelprovidesmany functionstohelpyou
cleanyourdataasfollows:
1. Import
2. TexttoColumns
3. RemoveDuplicates
4. Find&Replace
5. SpellCheck
6. =UPPER
7. =LOWER
8. =PROPER
9. =FIND
10.=SEARCH
11.=LEN
12.=SUBSTITUTE
13.=REPLACE
14.=LEFT
15.=MID
16.=RIGHT
17.=VALUE
18.=CONCATENATE
19.=TEXT
20.=TRIM
21.=CLEAN
22.=FIXED
23.=DOLLAR
24.=CODE
25.Macros
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
25/108
1. ImportingData intoExcelOfcourseexcelopensupexcelfiles,butwhathappenswhen
youattempttoopendatathatisnotcontainedinanExcelformat?TheansweristhatExcel
automatically imports that data on the fly and displays a Import Wizard to help you
completetheprocess.TheTextImportWizardexaminesthetextfilethatyouareimporting
andhelpsyouimportthedatathewaythatyouwant.TostarttheTextImportWizard,on
theDatatab,intheGetExternalDatagroup,clickFromText.Then,intheImportTextFiledialogbox,doubleclickthetextfilethatyouwantto import.Thefollowingdialogboxwill
bedisplayed:
If items in the text file are separated by tabs, colons, semicolons, spaces, or other
characters,
select
Delimited.
If
all
of
the
items
in
each
column
are
the
same
length,
select
Fixedwidth.Instep3,clicktheAdvancedbuttontospecifythatoneormorenumericvalues
maycontainatrailingminussign.Alsoclickthedesireddataformatforeachcolumntobe
imported.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
26/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page26 CopyrightMay2010
2. TexttoColumnsTheTexttoColumnscommandlocatedontheDataRibbonworksexactly
thesamewayasdescribedabove theusersimply launches ittoconvertdatawithinan
existingworksheet.
3. RemovingDuplicateRows Duplicaterowsareacommonproblemwhenyouimportdata.
You can identify and remove duplicate rows by using theData,Advanced Filter,Unique
RecordsOnlytoolasshowinthescreenbelow.
4. FindandReplaceTextThistoolcanbeusedtoidentifyandremoveleadingstring,suchas
alabelfollowedbyacolonandspace,orasuffix,suchasaparentheticphraseattheendof
thestringthatisobsoleteorunnecessary.Youcandothisbyfindinginstancesofthattext
andthenreplacingitwithnotextorothertext.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
27/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page27 CopyrightMay2010
NoteworthyFindandReplacePoints:
1. Youcansearchandreplaceforanentireworksheet,ortheentireworkbook.
2. Youcanfindandreplaceformatswithnewformats.
3. Thereisacellchooseroptionthatmakesiteasiertofindandreplaceformats.
4. Ifyouhighlightarangeofcells,thensearchandreplaceonlysearchesandreplaces
withinthatrangeofcells.
5. Youcanreplaceallatonceoroneatatime.
6. Youcouldalsofindandreplacereferencesinaformula.
5. SpellCheck Youcanuseaspellcheckertonotonlyfindmisspelledwords,buttofindvaluesthat
arenotusedconsistently,suchasproductorcompanynames,byaddingthosevaluestoacustom
dictionary.Thespellcheckfunctionalsochecksyourgrammaraswell.
Changing The CaseOf Text You can use one ormore of the three Case functions to
convert text to lowercase letters, such as email addresses, uppercase letters, such as
productcodes,orpropercase,suchasnamesorbooktitles.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
28/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page28 CopyrightMay2010
6. =UPPER Convertstexttouppercaseletters.
7. =LOWER Convertsalluppercaselettersinatextstringtolowercaseletters.
8. =PROPER Capitalizesthefirstletterinatextstringandanyotherlettersintextthatfollowany
characterotherthanaletter.Convertsallotherletterstolowercaseletters.
MergingAndSplittingColumns Acommontaskafterimportingdatafromanexternaldata
source istoeithermerge twoormorecolumns intoone,orsplitonecolumn intotwoor
morecolumns.Forexample,youmaywanttosplitacolumnthatcontainsafullnameintoa
first
and
last
name.
Or,
you
may
want
to
split
a
column
that
contains
an
address
field
into
separate street, city, region, and postal code columns. The reverse may also be true.
Presentedbelowarefunctionsthattohelpyouaccomplishthesetasks:
9. =FINDUseReturnsthestartingpositionofacharacter,stringofcharactersorwordwithacell.
Findiscasesensitive.
10.=SEARCHReturnsthestartingpositionofacharacter,stringofcharactersorwordwithacell.
Searchisnotcasesensitive.
11.=LENDisplaysthelengthornumberofcharactersinacell.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
29/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page29 CopyrightMay2010
12.=SUBSTITUTEReplacesacharacterorcharacterswithacharacterorcharactersthatyouspecify.
13.=REPLACE Replacesacharacterorcharacterswithacharacterorcharactersthatyouspecify.
14.=LEFTExtractsthespecifiednumberofcharactersfromacell,startingfromtheleft.
15.=MIDExtractsthespecifiednumberofcharactersfromacell,startingfromsomewhereinthe
middleofthecell.
16.=RIGHTExtractsthespecifiednumberofcharactersfromacell,startingfromtheright.
17.=ValueConvertstexttovaluessothedatacanbeadded,subtracted,multiplied,dividedor
referencedinafunction.
18.=CONCATENATE Joinstwoormoretextstringsintoonetextstring.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
30/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page30 CopyrightMay2010
Variationsofthesefunctionsthatareusedwhenworkingwithforeignlanguages:
=FINDBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
=SEARCHBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
=REPLACEBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
=LEFTBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
=RIGHTBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
=LENBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
=MIDBUsethiswhenworkingwithforeigncharacterslikethese( " , " )
Cleaning Text (Removing SpacesAndNonprintingCharacters FromText) Sometimes
text values contain leading, trailing, or multiple embedded space characters (Unicode
charactersetvalues32and160),ornonprintingcharacters(Unicodecharactersetvalues0
to31,127,129,141,143,144,and157).Thesecharacterscansometimescauseunexpected
resultswhenyousort,filter,orsearch.Forexample,intheexternaldatasource,usersmay
maketypographicalerrorsbyinadvertentlyaddingextraspacecharacters,orimportedtext
data fromexternalsourcesmaycontainnonprintingcharactersthatareembedded inthe
text. Because these characters are not easily noticed, the unexpected results may be
difficult to understand. Following is a list of functions you can use to remove these
unwantedcharacters:
19.=TEXT Convertsavaluetotextinaspecificnumberformat.
20.=TRIM Removesthe7bitASCIIspacecharacter(value32)fromtext.
21.=CLEAN Removesthefirst32nonprintingcharactersinthe7bitASCIIcode(values0
through31)fromtext.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
31/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page31 CopyrightMay2010
22.=FIXED Roundsanumbertothespecifiednumberofdecimals,formatsthenumberin
decimalformatbyusingaperiodandcommas,andreturnstheresult.
23.=DOLLAR Convertsanumbertotextformatandappliesacurrencysymbol.
24.=CODE Returnsanumericcodeforthefirstcharacterinatextstring.
FixingDatesandTimes Therearemanydifferentdateformats,andthesevariedformats
maybe confusedwithnumberedpart codesorother strings thatcontain slashmarksor
hyphens,datesandtimesoftenneedtobeconvertedandreformatted.Presentedbelowisalistoffunctionsthathelpyouaccomplishthistask.
25.=DATE Returnsthesequentialserialnumberthat representsaparticulardate. If thecell format
wasGeneralbeforethefunctionwasentered,theresultisformattedasadate.
26.=DATEVALUE Convertsadaterepresentedbytexttoaserialnumber.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
32/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page32 CopyrightMay2010
27.=TIME Returns thedecimalnumber foraparticulartime. If thecell formatwasGeneral
beforethefunctionwasentered,theresultisformattedasadate.
28.=TIMEVALUE Returnsthedecimalnumberofthetimerepresentedbyatextstring.The
decimalnumber is a value ranging from 0 (zero) to 0.99999999, representing the times
from0:00:00(12:00:00AM)to23:59:59(11:59:59P.M.).
TransformingAndRearrangingColumnsAndRows Mostof theanalysisand formatting
features inOfficeExcelassumethatthedataexists inasingle,flattwodimensionaltable.
Sometimesyoumaywant tomake the rowsbecome columns,and the columnsbecome
rows.Atothertimes,dataisnotevenstructuredinatabularformat,andyouneedawayto
transformthedatafromanontabulartoatabularformat.Thefollowingfunctioncanhelpyouachievethisgoal:
29.=TRANSPOSE Returnsaverticalrangeofcellsasahorizontalrange,orviceversa.
30.DataFill InTrickA clever trick for filling inmissingdata canbeaccomplishedusing theGOTO,
Special,Blankscommand.Hereishowitworks.Thistrickworkswellwhenyouhavealargevolume
ofdatabutdescriptionsarenotprovidedforeveryrow,asshownintheexamplebelow:
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
33/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page33 CopyrightMay2010
Startbyenteringasimpleformulareferencingthedatalabelintheabovecell,justlikethis:
a. Nextcopythatformula...
b. HighlighttheentirerangecontainingdatalabelsincolumnsAandB.columns...
c. PresstheF5keytolaunchtheGoTodialogbox...
d. SelecttheOptionsBox...
e. ClickontheBlanksradiobutton...
f. PressEnter...
g. Paste.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
34/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page34 CopyrightMay2010
Thisactionwillcausealldatalabelstorepeatintheemptycellsbeneath.Next:
h. CopycolumnsA&B...
i. PasteSpecialasvaluestoconverttheformulastotextbaseddatalabels...
j. Youarenowreadytosort,filter,subtotalandpivotyourdata.
FetchingData Occasionally,databaseadministratorsuseOfficeExcelto findandcorrect
matchingerrorswhen twoormore tablesarejoined.Thismight involve reconciling two
tables from different worksheets, for example, to see all records in both tables or to
comparetablesandfindrowsthatdon'tmatch.
31.=VLOOKUP Searchesforavalueinthefirstcolumnofatablearrayandreturnsavaluein
thesamerowfromanothercolumninthetablearray.Forexample,considertheexample
belowwhichusesa=VLOOKUP functiontocalculate theappropriateamount of taxdue
basedontheIRSrateschedule.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
35/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page35 CopyrightMay2010
As the Income statement shown in the shaded area is updated , the resulting taxable
incomeamount isreferenced inCellF13.Next,3VLOOKUPfunctionspulltheappropriate
rate, base and threshold information from the rate schedule to be used in calculating
incometax.Oncecalculated,theresultingtaxisreferencedbacktotheincomestatement
forthepurposesofcomputingNetincomeAftertaxes.
KeypointstoConsiderwhenUsingVLOOKUP:
a. If you are looking up based on text, the first column containing lookup
valuesmustbe sortedalphabetically indescendingorderelse itwillnot
workproperly.
b. Ifyouarelookingupbasedontext,youmusthaveanexactmatchbetween
thelookupvalueandthetablearrayvalue.
c. If youare lookingupbasedon values, the first column containing lookup
valuesmustbesortednumericallyindescendingorderelseitwillnotwork
properly.
d. If you are looking up based on values, then Excelwill choose the closest
valuewithoutgoingover.Forexample, if the lookupvalue is198,000and
the table array contains values of 100,000 and 200,000, the n excelwill
choose100,000because200,000goesoverorexceeds198,000.(Itmightbe
helpfultothinkbacktotheoldBobbarkergameshowthePriceisRight.)
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
36/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page36 CopyrightMay2010
32.=HLOOKUP Searchesforavalueinthetoprowofatableoranarrayofvalues,andthen
returnsavalueinthesamecolumnfromarowyouspecifyinthetableorarray.
33.=INDEX Returnsavalueorthereferencetoavaluefromwithinatableorrange.Thereare
twoformsoftheINDEXfunction:thearrayformandthereferenceform.
34.=MATCH Returns the relativepositionofan item inanarray thatmatchesa specified
value inaspecifiedorder.UseMATCH insteadofoneoftheLOOKUPfunctionswhenyou
needthepositionofaniteminarangeinsteadoftheitemitself.
35.=OFFSET Returnsareferencetoarangethatisaspecifiednumberofrowsandcolumns
fromacellorrangeofcells.Thereferencethatisreturnedcanbeasinglecellorarangeof
cells.Youcanspecifythenumberofrowsandthenumberofcolumnstobereturned.
36.DataCleaningwithMacros Toperiodicallycleanthesamedatasource,considerrecording
a macro or writing code to automate the entire process. There are also a number of
externaladdinswrittenbythirdpartyvendors, listed intheThirdpartyproviderssection,
thatyoucanconsiderusingifyoudon'thavethetimeorresourcestoautomatetheprocess
onyourown.
37.RAND( ), RANDBETWEEN( ), ROUND( ) In Excel 2003, RANDBETWEEN is not in the
standardEXCELinstallationbutiftheanalysistoolpackisinstalledandtheaddinactivated
itisanextremelyusefulfunction.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
37/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page37 CopyrightMay2010
38.InformationalFunctions
CELL(info_type,reference) Info_type is a text value that specifies what type of cellinformation youwant. The following list shows thepossible valuesof info_typeand the
correspondingresults.
Info_type Returns
"address" Referenceofthefirstcellinreference,astext.
"col" Columnnumberofthecellinreference.
"color" 1 if thecell is formatted incolor fornegativevalues;otherwise returns0
(zero).
"contents" Valueoftheupperleftcellinreference;notaformula.
"filename" Filename (including full path) of the file that contains reference, as text.
Returnsemptytext("")iftheworksheetthatcontainsreferencehasnotyet
beensaved.
"format" Textvaluecorrespondingtothenumberformatofthecell.Thetextvalues
forthevariousformatsareshowninthefollowingtable.Returns""atthe
endof the text value if the cell is formatted in color fornegativevalues.
Returns "()" at the end of the text value if the cell is formatted with
parenthesesforpositiveorallvalues.
"parentheses" 1 if the cell is formatted with parentheses for positive or all values;
otherwisereturns0.
"prefix" Text value corresponding to the "label prefix" of the cell. Returns single
quotationmark (') if the cell contains leftaligned text, double quotation
mark (") ifthecellcontainsrightalignedtext,caret (^) ifthecellcontains
centeredtext,backslash (\) ifthecellcontains fillalignedtext,andempty
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
38/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page38 CopyrightMay2010
text("")ifthecellcontainsanythingelse.
"protect" 0ifthecellisnotlocked,and1ifthecellislocked.
"row" Rownumberofthecellinreference.
"type" Text value corresponding to the type ofdata in the cell. Returns "b" forblankifthecellisempty,"l"forlabelifthecellcontainsatextconstant,and
"v"forvalueifthecellcontainsanythingelse.
"width" Columnwidthof the cell roundedoff to an integer. Eachunitof column
widthisequaltothewidthofonecharacterinthedefaultfontsize.
Reference the cell that youwant information about. Ifomitted, information specified in
info_typeisreturnedforthelastcellthatwaschanged.Thefollowinglistdescribesthetext
valuesCELL returnswhen info_type is "format",and reference isa cell formattedwitha
builtinnumberformat.
Ifthe
Microsoft
Excel
format
is
CELL
returns
General "G"
0 "F0"
#,##0 ",0"
0.00 "F2"
#,##0.00 ",2"
$#,##0_);($#,##0) "C0"
$#,##0_);[Red]($#,##0) "C0"
$#,##0.00_);($#,##0.00) "C2"
$#,##0.00_);[Red]($#,##0.00) "C2"
0% "P0"
0.00% "P2"
0.00E+00 "S2"
#?/?or#??/?? "G"
m/d/yyorm/d/yyh:mmormm/dd/yy "D4"
dmmmyyorddmmmyy "D1"
dmmmorddmmm "D2"
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
39/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page39 CopyrightMay2010
mmmyy "D3"
mm/dd "D5"
h:mmAM/PM "D7"
h:mm:ssAM/PM "D6"
h:mm "D9"
h:mm:ss "D8"
Iftheinfo_typeargumentintheCELLformulais"format",andifthecellisformattedlater
withacustomformat,thenyoumustrecalculatetheworksheettoupdatetheCELLformula.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
40/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page40 CopyrightMay2010
ThirdPartySolutionsIncaseExcelsbuiltinfunctionsarenotsufficienttomeetyour
needs,followingisapartiallistofthirdpartyprovidersthathaveproductsthatareusedto
cleandatainavarietyofways.
Provider Product
AddinExpressLtd. AdvancedFind&Replace,MergeCellsWizard
AddIns.com DuplicateFinder
AddinTools AddinToolsAssist
CDX ZipStream
Click2Convert ConvertsPDFtoExcelformats
DigDB AddinsforExcel
JKPApplicationDevelopment FlexfindforExcel
JWalk&Associates,Inc. PowerUtilityPakVersion7
OfficeAssistanceLLC SimilarDataFinderforExcel
PATools PAToolsAdvancedFindReplace
PDF2XL ConvertsPDFfilestoExcelFormats
SpinnakerSoftwareSolutions SpinnakerDBtoolsforExcel
Vonnix ExcelPowerExpander4.6
WinPure ListCleanerLite
ListCleanerPro
CleanandMatch2007
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
41/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page41 CopyrightMay2010
Chapter4
DataCommandsTheHeart&SoulOfExcel
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
42/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page42 CopyrightMay2010
TheDataMenu PerhapsthepartsofExcelthatareofmostvaluetoCPAs,butleastused
byCPAsaretheDatacommandsfoundundertheDatamenuinExcel2003andearlier,and
on the data Ribbon in Excel 2007. These commands are shown below, and we will
concentratethenexthourtostudyingthesecommands.
DataSort
The Sort tooldoesexactlywhat it implies it sorts anddata.Key sorting
pointsareasfollows:
1. Contiguous Data The A to Z sorting tool can sort large matrix of data
automaticallyaslongasthedataiscontiguous.Inotherwords,yourdatashould
containnoblankcolumns,noblankrows,andthecolumnsmustallbe labeled.
OnlythenwillExcelalwayscorrectlyselecttheentirematrixforsorting.
2. A to ZButton Simplyplace the cursor in thedesired column for sorted, and
presstheAtoZorZtoAbuttonasthecasemaybe.Excelwillautomaticallysort
allcontinuouscolumnsthathaveheadingsandallcontiguousrowsfromthetoprowundertheheading labelsdownto the last row intheselectedcolumn that
contains data. (Note If you accidently select 2 cells instead ofjust one, your
resultswillnotbecorrect.)
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
43/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page43 CopyrightMay2010
3. Sortby64ColumnsTheSorttoolisdramaticallyenhancedinExcel2007asit
nowprovidestheabilitytosortbyupto64columns, insteadofjust3columns.
Presentedbelowisadialogboxwhichshowsthisexpandedfunctionality.
4. SortLefttoRightExcelhasalwaysprovidedtheabilitytosortlefttoright.Todo
so,selecttheoptionsbox intheSortDialogboxandclickthecheckbox labeled
SortlefttoRightasshownbelow.
5. SortbyColorExcel2007nowprovidestheabilitytosortbyfontcolororbycell
color,orboth.This ishandy inmanyways.SometimesCPAsusecolorto tagor
markcertaincells andlaterfinditusefultobeabletosortbythosemarkings.In
other situationsCPAsuse conditional formatting toapply color to cellsusinga
widevarietyof rules.ThereafterExcelcan sort thedatabasedon the resulting
colors.Thesortbycoloroptionsareshownbelow.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
44/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page44 CopyrightMay2010
Tobeaccurate,itwaspossibletosortbycolorinExcel2003.Toaccomplishthis
task,youneededtousethe=CELLfunctioninordertoidentifyinformationabout
a given cell such as the cell coloror font color. Thereafter, the resultsof that
functioncouldbeusedtosortrowswhicheffectivelymeansthatyoucansort
bycolorinExcel2003butittakesabitmoreeffort.
6. SortByCustomListAnothersortingcapability inExcel istheabilitytosortby
CustomList.Forexample,assumeaCPAfirmhastenpartners,andtheManaging
partnerprefers tobe shownat the topof the list,and the remainingPartners
based on seniority. In this case, you could create a Custom List in the excel
Optionsdialogboxlistingthepartnersinthedesiredorder,andthensortfuture
reportsbasedonthatorder.
Perhapsabetterexampleuseofthisfeaturewouldbetocreateanonalphabetic
custom listof your chartof accounts, and then sort transactions toproduce a
generalledgerinchartofaccountorderevenifyourpreferredchartofaccounts
isnotalphabetical. thepartnersenioritydoesnotmatch thealphabeticnames,
norany
FilteringData UsingAutoFiltertofilterdataallowsyoutoviewasubsetofyourdatainarangeofcellsortable.Onceyouhavefilteredthedata,youcanapplyadditionalfilters
to furtherrefineyourdataview.Whenyouaredone,youcancleara filtertoonceagain
redisplay all of the data. To use this tool, start with any list of data and turn on the
AutoFiltertool.Thenpositionyourcursorinthecolumnyouwanttofilterandusethedrop
downarrowstoapplyyourfiltersasshowninthescreenbelow.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
45/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page45 CopyrightMay2010
Once the filters are applied, you will see a subset your data. For example, the screen
presentedbelowshowsfiltereddataforonlyMaconandSavannahproperties.
Asfiltersareapplied,asmallfunnelappearsinthedropdownarrowbuttontoindicatethat
afilterhasbeenapplied.Youcanapplyfiltersformultiplecolumnssimultaneously.
KeyPointsConcerningTheAutoFilterCommand:
1. ContiguousDataTheAutoFiltertoolsworksbestwhenyouareworkingwithdata
that is contiguous. Inotherwords,yourdata should containnoblank columns,no
blankrows,andthecolumnsmustallbelabeled.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
46/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page46 CopyrightMay2010
2. FilterbyMultipleColumns Youcanfilterbymorethanonecolumn.
3. RemovingFiltersInExcel2003andearlier,afasterwaytoremovemultiplefiltersis
toturnofffilteringandthenturnfilteringbackon.InExcel2007youcansimpleclick
theClearbuttonintheSortandFilterGroupasshownbelow.
4. FiltersareAdditive Eachadditionalfilterisbasedonthecurrentfilterandfurther
reducesthesubsetofdata.
5. ThreeTypes
of
FiltersYoucanfilterbasedonlistvalues,byformats,orbycriteria.
Eachofthesefiltertypesismutuallyexclusiveforeachrangeofcellsorcolumntable.
Forexample,youcanfilterbycellcolororbyalistofnumbers,butnotbyboth;you
canfilterbyiconorbyacustomfilter,butnotbyboth.
6. Filters Enabled A dropdown arrow means that filtering is enabled but not
applied.
7. FilterAppliedAFilterbutton meansthatafilterisapplied.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
47/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page47 CopyrightMay2010
8. FilterSpanning Thecommandsunder
theAllDates inthePeriodmenu,such
as January orQuarter 2, filter by the
period nomatterwhat the year. This
canbeuseful,forexample,tocompare
salesbyaperiodacrossseveralyears.
9. This Year vs. YeartoDate Filtering
This Year and YeartoDate are
different in theway that future dates
arehandled.ThisYearcanreturndates
in the future for the current year,
whereas Year to Date only returns
dates up to and including the current
date.
10.Filtering Dates All date filters are
based on the Gregorian calendar as
decreed by Pope Gregory XIII, after
whomthecalendarwasnamed,on24
February1582.TheGregorian calendarmodifies the Julian calendar's regular four
yearcycleofleapyearsasfollows:Everyyearthatisexactlydivisiblebyfourisaleap
year,except foryears thatareexactlydivisibleby100; thecenturialyears thatare
exactlydivisibleby400arestill leapyears.Forexample,theyear1900 isnota leap
year;theyear2000isaleapyear.
11.FilteringBy
Days
of
Week
Ifyouwanttofilterbydaysoftheweek,simplyformat
thecellstoshowthedayoftheweek.
12.Top&BottomFiltering OntheDatatab,in
theSort&Filtergroup,clickFilter.Pointto
Number Filtersand then selectTop10.To
filter by number, click Items. To filter by
percentage, click Percent. Note Top and
bottom values are based on the original
rangeof cellsor table columnandnot the
filteredsubset
of
data.
13.Above&BelowAverageFiltering On the
Data tab, in the Sort & Filter group, click
Filter. Point to Filter byNumbers that are
Above/BelowAverage.NoteThesevalues
arebasedon theoriginal rangeof cellsor
tablecolumnandnotthefilteredsubsetofdata.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
48/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page48 CopyrightMay2010
14.FilteringOutBlanks Tofilterforblanks,intheAutoFiltermenuatthetopofthelist
of values, clear (Select All), and then at the bottom of the list of values, select
(Blanks).
15.FilteringBy
Color SelectFilterbyColor,andthendependingonthetypeofformat,
selectFilterbyCellColor,FilterbyFontColor,orFilterbyCellIcon.
16.FilterbySelection Tofilterbytext,number,ordateortime,clickFilterbySelected
Cell'sValueand then:To filterbycell color,clickFilterbySelectedCell'sColor.To
filterby font color, click FilterbySelectedCell's FontColor.To filterby icon, click
FilterbySelectedCell'sIcon.
17.RefreshingFiltersToreapplyafilterafterthedatachanges,clickacellintherange
ortable,andthenontheDatatab,intheSort&Filtergroup,clickReapply.
DataFormExcels2003DataFormtoolmakesExcellookmoreandbehavemorelikeadatabase,suchasMicrosoftAccess.(TheFormbuttonhasnotbeenincludedontheOffice
FluentuserinterfaceRibbon,butyoucanstilluseitinOfficeExcel2007byaddingtheForm
buttontotheQuickAccessToolbar.)
A data form provides a convenient means to enter or display one complete row of
informationinarangeortablewithoutscrollinghorizontally.Youmayfindthatusingadata
formcanmakedataentryeasierthanmovingfromcolumntocolumnwhenyouhavemore
columnsofdatathancanbeviewedonthescreen.Useadataformwhenasimpleformof
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
49/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page49 CopyrightMay2010
text boxes that list the column headings as labels is sufficient and you don't need
sophisticatedorcustomformfeatures,suchasalistboxorspinbutton.
KeyPointsusingdataForm:
1. Youcannotprintadataform.
2. Becauseadata form isamodaldialogbox, you cannotuseeither theExcelPrint
commandorPrintbuttonuntilyouclosethedataform.
3. Youmight considerusing theWindowsPrintScreenkey tomakean imageof the
form,andthenpasteitintoMicrosoftWordforprinting.
Data Subtotals Excel provides an automatic subtotalingwhichwill automatically
calculateand insert subtotals and grand totals in your listor table.Once inserted, Excelrecalculatessubtotalandgrandtotalvaluesautomaticallyasyouenterandeditthedetail
data.TheSubtotalcommandalsooutlinesthelistsothatyoucandisplayandhidethedetail
rows foreach subtotal.Examplesofa theSubtotaldialogboxanda resulting subtotaled
tableareshownbelow.
KeypointstoConsiderWhenUsingSubtotalingareasfollows:
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
50/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page50 CopyrightMay2010
1. ContiguousDataTheSubtotal toolsworksbestwhenyouareworkingwithdata
that is contiguous. Inotherwords,yourdata should containnoblank columns,no
blankrows,andthecolumnsmustallbelabeled.
2. SortBefore
Your
Subtotal Youmust sort the data by the column youwish to
Subtotalby,elseyouwillreceiveerroneousresults.
3. OtherMathematicalApplications TheSubtotaltoolnotonlycalculatessubtotals,
but itcanalsocalculateminimums,maximums,averages,standarddeviations,and
otherfunctions.
4. Subtotalsin2007TablesExcel2007deploysSubtotalingalittledifferentlyinthat
theSubtotaltoolappearsatthebottomofeachcolumn ineachtable,asshown in
thescreenbelow.
5. Automatic Outlining Subtotaling automatically inserts Outlines, which is really
cool.You can thencondenseandexpand thedata in totalandby subtotal.Some
CPAs also like to copy and paste the condensed subtotal information to another
locationbutfindthatthisprocesscopiesandpastesallofthedata.Therearetwo
ways to achieve a clean copy and pastewithout grabbing all the hidden data as
follows:
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
51/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page51 CopyrightMay2010
a. CTRLkeyHoldtheControlKeydownwhileyouindividuallyclickoneachsubtotal
row.Thiswillenableyoutocopyandpastejustthesubtotaldata.Thisapproachcan
beproblematicbecauseifyoumisclick,youhavetostartover.
b. SelectVisibleCellsAbetterapproach is touse theSelectVisibleCells tool.This
toolwillselectonthedatayoucansee,afterwhichthecopyandpasteroutinewillyield the desired results. This option is better because it is faster and less error
prone.
DataValidation
DataValidationcanbeusedto limitthedatathatcanbeentered intoacell.Forexample,
youmightwanttheusertoenteronlyvaluesbetween1%and99%.Youmightalsousethis
tool toenabledata input toadropdown list.Thishas twoadvantages in that it canbe
fasterandmoreaccurate. Startwith thedialogboxbelow tocreateyourdropdown list
functionality.
Aftermakingall thenecessary selections in thevalidation listdialogbox,yourworksheet
willbehaveasshownbelow.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
52/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page52 CopyrightMay2010
Youcanalsoprovidemessagestodefinewhatinputyouexpectforthecell,andinstructions
tohelpuserscorrectanyerrors.Forexample,inamarketingworkbook,youcansetupacell
toallowonlyaccountnumbersthatareexactlythreecharacterslong.Whenusersselectthe
cell,youcanshowthemamessagesuchasthisone:
Ifusersignorethismessageandtypeinvaliddatainthecell,suchasatwodigitorfivedigit
number, you can show them an actualerrormessage. Inamoreadvanced scenario, you
mightusedatavalidationtocalculatethemaximumallowedvalueinacellbasedonavalue
elsewhere intheworkbook. Inthefollowingexample,theuserhastyped$4,000 incellE7,
whichexceedsthemaximumlimitspecifiedforcommissionsandbonuses.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
53/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page53 CopyrightMay2010
If the payroll budget were to increase or decrease, the allowed maximum in E7would
automaticallyincreaseordecreasewithit.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
54/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page54 CopyrightMay2010
PivotTables
ThePivotTablereporttoolprovidesaninteractivewaytosummarizelargeamountsofdata.
UseshouldusethePivotTabletoolstocrunchandanalyzenumericaldataPivotTable
reportsareparticularlyusefulinthefollowingsituations:
a. Rearrangingrowstocolumnsorcolumnstorows(or"pivoting")toseedifferent
summariesofthesourcedata.
b. Filtering,sorting,grouping,andconditionallyformattingyourdata.
c. Preparingconcise,attractive,andannotatedonlineorprintedreports
d. Queryinglargeamountsofdata.
e. Subtotalingandaggregatingnumericdata.
f. Summarizingdatabycategoriesandsubcategories
g. Creatingcustomcalculationsandformulas.
h. Expandingandcollapsinglevelsofdata.
i. Drillingdowntodetailsfromthesummarydata
Inessence,PivotTablespresentmultidimensionaldataviews to theuser thisprocess is
oftenreferredtoasmodeling,datacubeanalysis,orOLAPdatacubes. Torearrange
thePivotTabledata,justdraganddrop columnand rowheadings tomovedataaround.
PivotTablesareagreatdataanalysistoolformanagement.
IfyouhaveneverusedaPivotTablebefore, initially theconceptcanbedifficult tograsp.
ThebestwaytounderstandaPivotTableistocreateablankPivotTableandthendragand
drop field names onto that blank table. Thisway youwill see the resulting pivot table
magicallyappearanditwillhelpyoubetterunderstandtheimportantrelationshipbetween
thepivotpalletandthefieldnamelist.
Lets createa simplePivotTable.StartwithanExcelworksheetdata that contains several
columnsofdatathedatamustincludecolumnandrowheadingsandithelpsifthedatais
contiguous. Place your cursor anywhere in the data and select PivotTable from theData
menuinExcel2003andclickFinish;orfromtheinsertRibboninExcel2007. Thisprocessis
shownbelow:Letsstartwithapageofdatasummarizingtheresultsoftaxseasonasallof
thetimesheetentrieshavebeenenteredontoasingleworksheetasshownbelow.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
55/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page55 CopyrightMay2010
Place your cursor anywhere in the data and select PivotTable from the Insert Ribbon as
shownbelow:
ForlearningpurposesletsrightmouseclickonthepivottableandselectPivotTableOptions,
Display,ClassicPivotTableLayout.Yourscreenwillnowappearasfollows:
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
56/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page56 CopyrightMay2010
I like forCPAs to learnhow tousePivotTables inthisviewbecause itvisuallyhelpsthem
understandtheall importantrelationshipbettertheblankpivotpaletteandthePivotTable
fieldList,bothelementsofwhichareshowninthescreenabove.
To proceed, simply drag and drop field names shown on the right onto the blank Pivot
paletteshownonthe left.Witheachdrop,yourreportgrows larger.Asanalternativeyou
couldusethecheckboxesnexttofieldnamesthisfunctionalityisnewinExcel2007.After
addedsomedatatoyourblankPivotPalette,yourdatawilllooksomethinglikethis:
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
57/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page57 CopyrightMay2010
NextformatandfilterthePivotReport.Veryquicklyyourreportcomestogetherasshown
below.NoticethefilterbuttonhasbeenappliedandaPivottablestylehasalsobeenapplied
forappearance.
Doubleclickingonanynumberinapivotreportwillautomaticallyproduceanewworksheet
completewithallsupportingdetailthatcomprisesthesummarynumber.
ThereareamultitudeofPivotTableoptionsthatcanbeappliedtoaltertheappearanceor
behaviorofyourPivottable.
KeyPointsConcerningPivotTablesareasFollows:
a. YoucancreateasmanyPivotReportsasyouwantfromyourinitialrawdatapage.Yourraw
dataremainsunchangedasnewPivottablesarecreated.
b. As your rawdata changes, yourpivot tablesareupdatedeach timeyoupress the refresh
button. Or if you prefer you can set your PivotTables to update themselves at regularly
scheduledintervalssayeverytenminutes.
c. A key to understanding PivotTables is understanding the relationship between the Blank
Pivotpaletteand thePivotTableField list.Asdata isselected in the list, itappearson the
PivottableReport.
d. You canalter thePivotTable simplebydragginganddropping the fieldnames indifferent
locationsonthePivotpalette,orindifferentlocationsinthePivotTableFieldlistBox.
e. PivotTablescanbepivoted.
f. PivotTablescanbesortedbyanyColumn.(Orbyanyrowwhensortinglefttoright)
g. PivotTablescanbeFiltered.
h. PivotTablescanbeDrilled.
i. PivotTablescanbecopiedandpasted.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
58/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page58 CopyrightMay2010
j. PivotTablescanbeformattedusingPivotTableStyles,asshownbelow.
k. Subtotalsandgrandtotalscanbedisplayedorsuppressedattheusersdesire.
l. PivotTableDatacanbeshownasnumbersorpercentagesattheusersdesire.
m. PivotTablecannotonlybesummed,itcanbeaveraged,minimized,maximized,counted,etc.
n. Blankrowscanbedisplayedorsuppressedattheusersdesire.
o. A new feature called Compact Form organized multiple column labels into a neatlyorganizedoutlinewhichiseasiertoread.
p. PivotTablescanquerydatadirectlyfromanyODBCcompliantdatabase.ThePivotTabletool
foraccomplishingthistaskisnotincludedintheribbonyouwillfinditbyCustomizingthe
QuickAccessToolBarandsearchingtheCommandsNotShown intheRibbontabtofind
thePivotTableandPivotChartWizardOption.
q. Many accounting systems can push data out of the accounting system into an Excel
PivotTableformatthis iscommonlyreferredtoasanOLAPDataCube.OLAPdataCube is
justafancywordforPivotTableandthereisnodifference.
r. PivotTablescanautomaticallycombinedatafrommultipledatasources.ThePivotTabletool
foraccomplishingthistaskisnotincludedintheribbonyouwillfinditbyCustomizingthe
QuickAccessToolBarandsearchingtheCommandsNotShown intheRibbontabto find
thePivotTableandPivotChartWizardOption.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
59/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page59 CopyrightMay2010
s. Excel also provides a PivotChart functionwhichworks similarly to PivotTables. Presented
belowisanexamplePivotChart.
Excel2003PivotTablesworkverysimilarlyasshownbelow.ExcelcreatesablankPivotTable,
andtheusermustdraganddropthevarious fields fromthePivotTableFieldListontotheappropriatecolumn, row,ordatasection.Asyoudraganddrop these items,theresulting
reportisdisplayedonthefly.HereistheblankPivotPaletteview.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
60/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page60 CopyrightMay2010
Nowdrag anddrop fieldnames from thePivot Table field listonto thePivotpallet. This
actionwillautomatically createPivotTable reportsand theywill changeeach time you
dropadditional fieldnames,ormove fieldnamesaround.Presentedbelowarebuta few
examplesofhundredsofpossible reportsthatcouldbeviewedwiththisdatathroughthe
PivotTableformat.
This report shownabove shows the total resulting sales foreachmarketing campaign for
eachofthe4monthsmarketingcampaignswereconducted.
In this screenwe see the same information is shownasapercentageof the total.A few
observations include the fact that overall Radio Spots are the most profitable type of
campaign, but only in April and July. In January and October, local ads and directmail,
respectively,producebetterresults.Further,Aprilcampaignshadthebestresponseoverall.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
61/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page61 CopyrightMay2010
Furtheranalysisinthescreenabovetellsusthatourresultsvarywidelyfromonecitytothe
next. In New York, coupons were least effective, but coupons were most effective in
Columbus. Pivot charts based on PivotTable data can be modified by pivoting and/or
narrowing the data. They can also be published on the Internet (or on an Intranet) as
interactiveWebpages. Thisallowsuserstoplaywiththedata.Thechartbelowprovidesa
visuallookatthedatashownabove.
FilteringPivotTables Ifyoutakeacloselookatyourresultingpivottables,youwillnotice
thatExcelautomaticallyinsertsafilterbuttononeachfieldlistasshownbythedropdown
arrowsinthescreenbelow:
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
62/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page62 CopyrightMay2010
Thisdropdown filter listmakes iteasy to refine your report to includejust thedatayou
want.
Drilling Pivot Tables Another nice feature in pivot tables is that they are automatically
drillable.Simplydoubleclickonanynumber inapivotreporttophaveExcelautomatically
insertanewsheetandproducethedetailedreportunderlyingthenumberyouclickedon.
Anexampleofthisisshownbelow:
Pivot TableOptions By rightmouse clicking on yourpivot table youwill reveal several
optionsettingsboxesasshownbelow.Forexample,theseoptionsboxescontrolthetypesof
subtotalsproducedinyourpivotreports.Excelalsooffersapivottableoptionsboxaswellas
alayoutwizardthatmakesproducingpivottablesalittleeasier.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
63/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page63 CopyrightMay2010
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
64/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page64 CopyrightMay2010
DataTable(WhatifAnalysis)
Datatablesarepartofasuiteofcommandsthatarecalledwhatifanalysistools.Whenyou
usedatatables,youaredoingwhatifanalysis.Whatifanalysisistheprocessofchanging
the values in cells to seehow those changeswill affect theoutcome of formulas on the
worksheet.Forexample,youcanuseadatatabletovarytheinterestrateandtermlength
thatareusedinaloantodeterminepossiblemonthlypaymentamounts.
ThreecategoriesofWhatifAnalysisTools Therearethreekindsofwhatifanalysistoolsin
Excel:
1. DataTables
2. GoalSeek
3. Scenarios
Adata table cannotaccommodatemore than two variables. Ifyouwant toanalyzemorethan twovariables,youshould insteadusescenarios.Although it is limited toonlyoneor
twovariables(onefortherowinputcellandoneforthecolumninputcell),adatatablecan
includeasmanydifferentvariablevaluesasyouwant.Ascenariocanhaveamaximumof32
differentvalues,butyoucancreateasmanyscenariosasyouwant.
LoanAnalysis Inthisexercise,westartbycreatingasimplePaymentfunctiontocalculate
thepaymentamountofaloangivenaloanamount,interestrateandnumberofperiods.
ThenextstepistocreateaTwoWayDataTabledisplayingtheresultingpaymentamount
given a variety of lengths of the loan. This process is started by creating a list of the
alternative loanamounts,asshownbelow inB8,B9,B10,etc.CellC7mustreferencethe
resultsyouwanttobedisplayedinthetable.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
65/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page65 CopyrightMay2010
ThenextstepistohighlightthedatatablerangeandusetheDataTablecommandundertheDatamenu(asshownbelow)togeneratethedesiredtable.
Thisprocesswillgeneratethefollowingtable:
Thistabletellsusthatthesameloanamountwillrequireamonthlypaymentof$3,331to
paytheloanoffinjust10years,andamonthlypaymentof$5,800torepaytheloaninjust
5years.
7/13/2019 2010 Excel Functions Macros and Data Commands Manual as of March 2010
66/108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.com Page66 CopyrightMay2010
Thenextstepinthisexerciseistogeneratealinechartbasedonthedatatablewejust
created.Thislinechartwillprovidesomeinterestingobservationsregardingthebenefits
anddetrimentsofpayingoffloansoverlongerperiods.
Theresultingchartisshownasfollows:
Basedon this,noone shouldeverobtaina fairmarket loan formore than15years, th