2010 Excel Functions Macros And Data Commands Manual As Of March

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 108 [warning: Documents this large are best viewed by clicking the View PDF Link!]


MicrosoftExcel
Functions,Macros&
DataCommands
J.CarltonCollins,CPA
ASAResearch
Atlanta,Georgia
770.734.0950
Carlton@ASAResearch.com
A
SA Research
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage2CopyrightMay2010
TableofContents
Chapter1ExcelFunctions..........................................................................4
Chapter2TheIfFunction.........................................................................18
Chapter3UsingFunctionstoClean&CrunchData.................................23
Chapter4DataCommands......................................................................41
Chapter5‐Macros.....................................................................................76
Chapter6Miscellaneous.........................................................................81
Chapter7XMLData.................................................................................84
Chapter8QuickTips................................................................................92
Chapter9What’sNewinExcel2007.......................................................95
Chapter10What’snewinExcel2010....................................................104
Appendix‐Instructor’sBiography............................................................108
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage3CopyrightMay2010
ExcelFunctions,Macros&DataCommands
CourseInformation
LearningObjectives ToincreasetheproductivityofaccountantsandCPAs
usingExcel’sfunctions,macros,&datacommands
CourseLevel Intermediate
PreRequisites GoodFamiliaritywithMicrosoftExcel
AdvancedPreparation None
PresentationMethod Livelectureusingfullcolorprojectionsystemsand
liveInternetaccesswithfollowupcoursematerials
RecommendedCPECredit 8hours
Handouts Templates,checklists,webexamples,manual
Instructors J.CarltonCollins,CPA
AdvisorCPEisregisteredwiththeNationalAssociationof
StateBoardsofAccountancy(NASBA)asasponsorof
continuingprofessionaleducationontheNational
RegistryofCPESponsors.Stateboardsofaccountancy
havefinalauthorityontheacceptanceofindividual
coursesforCPEcredit.Complaintsregardingregistered
sponsorsmaybeaddressedtothenationalRegistryof
CPESponsors,150FourthAvenue,Nashville,TN,37219
2417.Telephone:6158804200.
Copyright©May2010,AdvisorCPEandAccountingSoftwareAdvisor,LLC
4480MissendellLane,Norcross,Georgia30092770.734.0450
Allrightsreserved.Nopartofthispublicationmaybereproducedortransmittedinanyformwithouttheexpress
writtenconsentofAdvisorCPEorASAResearch,subsidiariesofAccountingSoftwareAdvisor,LLC.Requestmaybe
emailedtomarylou@advisorcpe.comorfurtherinformationcanbeobtainedbycalling770.734.0450orby
accessingtheAdvisorCPEhomepageat:http://www.advisorcpe.com/
Alltradenamesandtrademarksusedinthesematerialsarethepropertyoftheirrespectivemanufacturersand/or
owners.Theuseoftradenamesandtrademarksusedinthesematerialsarenotintendedtoconveyendorsement
ofanyotheraffiliationswiththesematerials.Anyabbreviationsusedhereinaresolelyforthereader’s
convenienceandarenotintendedtocompromiseanytrademarks.Someofthefeaturesdiscussedwithinthis
manualapplyonlytocertainversionsofExcel,andfromtimetotime,Microsoftmightremovesomefunctionality.
MicrosoftExcelisknowntocontainnumeroussoftwarebugswhichmaypreventthesuccessfuluseofsome
featuresinsomecases.AdvisorCPEmakesnorepresentationsorwarrantywithrespecttothecontentsofthese
materialsanddisclaimsanyimpliedwarrantiesofmerchantabilityoffitnessforanyparticularuse.Thecontentsof
thesematerialsaresubjecttochangewithoutnotice.
ContactInformation:
J.CarltonCollins
carlton@asaresearch.com
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage4CopyrightMay2010
Chapter1
ExcelFunctions

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage5CopyrightMay2010
IntroductiontoExcelFunctions
ExcelFunctionsarepreprogrammedformulasthatmakethetaskofwritingcomplexformulas
easier.Thereareatotalof333functionsinExcel.Thesefunctionsareseparatedinto11
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
relevanttotheCPAthanothers.Forexample,mostCPAswillfindtheIF,SUM,COUNT,
SUBTOTAL,TEXT,andVLOOKUPareveryrelevanttotheCPAwhileotherengineeringand
trigonometryfunctionssuchasLOG,PI,RADIENS,DELTA,TAN,COMPLEX,andHAX2DECare
typicallylessrelevanttoCPAs.Ithasbeenmyexperiencethatthefollowing75functionsare
mostrelevanttotheCPA;thereforeinmyopinion,CPAswishingtoincreasetheircommandof
Excelfunctionsshouldconcentrateonthesefunctionsfirst.
Carlton’sListofTheTop75FunctionsMostRelevanttoCPAs
(SortedByCarlton’sOpinionofUsefulness)
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
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage6CopyrightMay2010
12. VLOOKUP‐Looksinthefirstcolumnofanarrayandmovesacrosstherowtoreturnthevalueof
acell
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‐Returnsaspecificnumberofcharactersfromatextstringstartingatthepositionyou
specify
24. FIND‐Findsonetextvaluewithinanother(casesensitive)
25. SUBSTITUTE‐Substitutesnewtextforoldtextinatextstring
26. LEN‐Returnsthenumberofcharactersinatextstring
27. 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‐Returnsthepercentagerankofavalueinadataset
48. PMT‐Returnstheperiodicpaymentforanannuity
49. NPV‐Returnsthenetpresentvalueofaninvestmentbasedonaseriesofperiodiccashflows
andadiscountrate
50. DSUM‐Addsthenumbersinthefieldcolumnofrecordsinthedatabasethatmatchthecriteria
51. DCOUNT‐Countsthecellsthatcontainnumbersinadatabase
52. DCOUNTA‐Countsnonblankcellsinadatabase
53. AND‐ReturnsTRUEifallofitsargumentsareTRUE
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage7CopyrightMay2010
54. OR‐ReturnsTRUEifanyargumentisTRUE
55. CHOOSE‐Choosesavaluefromalistofvalues
56. TIME‐Returnstheserialnumberofaparticulartime
57. FV‐Returnsthefuturevalueofaninvestment
58. IRR‐Returnstheinternalrateofreturnforaseriesofcashflows
59. YIELD‐Returnstheyieldonasecuritythatpaysperiodicinterest
60. 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,an
intranet,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,carlton@asaresearch.com
All333ExcelFunctions
OrganizedByCategory,IncludingADescriptionOfEachFunction
DatabaseFunctions
FunctionDescription
1DAVERAGEReturnstheaverageofselecteddatabaseentries
2DCOUNTCountsthecellsthatcontainnumbersinadatabase
3DCOUNTACountsnonblankcellsinadatabase
4DGETExtractsfromadatabaseasinglerecordthatmatchesthespecifiedcriteria
5DMAXReturnsthemaximumvaluefromselecteddatabaseentries
6DMINReturnstheminimumvaluefromselecteddatabaseentries
7DPRODUCTMultipliesthevaluesinaparticularfieldofrecordsthatmatchthecriteriain
adatabase
8DSTDEVEstimatesthestandarddeviationbasedonasampleofselecteddatabase
entries
9DSTDEVPCalculatesthestandarddeviationbasedontheentirepopulationofselected
databaseentries
10DSUMAddsthenumbersinthefieldcolumnofrecordsinthedatabasethatmatch
thecriteria
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage8CopyrightMay2010
11DVAREstimatesvariancebasedonasamplefromselecteddatabaseentries
12DVARPCalculatesvariancebasedontheentirepopulationofselecteddatabase
entries
 
DateandTimeFunctions
FunctionDescription
13DATEReturnstheserialnumberofaparticulardate
14DATEVALUEConvertsadateintheformoftexttoaserialnumber
15DAYConvertsaserialnumbertoadayofthemonth
16DAYS360Calculatesthenumberofdaysbetweentwodatesbasedona360dayyear
17EDATEReturnstheserialnumberofthedatethatistheindicatednumberofmonths
beforeorafterthestartdate
18EOMONTHReturnstheserialnumberofthelastdayofthemonthbeforeoraftera
specifiednumberofmonths
19HOURConvertsaserialnumbertoanhour
20MINUTEConvertsaserialnumbertoaminute
21MONTHConvertsaserialnumbertoamonth
22NETWORKDAYSReturnsthenumberofwholeworkdaysbetweentwodates
23NOWReturnstheserialnumberofthecurrentdateandtime
24SECONDConvertsaserialnumbertoasecond
25TIMEReturnstheserialnumberofaparticulartime
26TIMEVALUEConvertsatimeintheformoftexttoaserialnumber
27TODAYReturnstheserialnumberoftoday'sdate
28WEEKDAYConvertsaserialnumbertoadayoftheweek
29WEEKNUMConvertsaserialnumbertoanumberrepresentingwheretheweekfalls
numericallywithayear
30WORKDAYReturnstheserialnumberofthedatebeforeorafteraspecifiednumberof
workdays
31YEARConvertsaserialnumbertoayear
32YEARFRACReturnstheyearfractionrepresentingthenumberofwholedaysbetween
start_dateandend_date
EngineeringFunctions
FunctionDescription
33BESSELIReturnsthemodifiedBesselFunctionIn(x)
34BESSELJReturnstheBesselFunctionJn(x)
35BESSELKReturnsthemodifiedBesselFunctionKn(x)
36BESSELYReturnstheBesselFunctionYn(x)
37BIN2DECConvertsabinarynumbertodecimal
38BIN2HEXConvertsabinarynumbertohexadecimal
39BIN2OCTConvertsabinarynumbertooctal
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage9CopyrightMay2010
40COMPLEXConvertsrealandimaginarycoefficientsintoacomplexnumber
41CONVERTConvertsanumberfromonemeasurementsystemtoanother
42DEC2BINConvertsadecimalnumbertobinary
43DEC2HEXConvertsadecimalnumbertohexadecimal
44DEC2OCTConvertsadecimalnumbertooctal
45DELTATestswhethertwovaluesareequal
46ERFReturnstheerrorFunction
47ERFCReturnsthecomplementaryerrorFunction
48GESTEPTestswhetheranumberisgreaterthanathresholdvalue
49HEX2BINConvertsahexadecimalnumbertobinary
50HEX2DECConvertsahexadecimalnumbertodecimal
51HEX2OCTConvertsahexadecimalnumbertooctal
52IMABSReturnstheabsolutevalue(modulus)ofacomplexnumber
53IMAGINARYReturnstheimaginarycoefficientofacomplexnumber
54IMARGUMENTReturnstheargumenttheta,anangleexpressedinradians
55IMCONJUGATEReturnsthecomplexconjugateofacomplexnumber
56IMCOSReturnsthecosineofacomplexnumber
57IMDIVReturnsthequotientoftwocomplexnumbers
58IMEXPReturnstheexponentialofacomplexnumber
59IMLNReturnsthenaturallogarithmofacomplexnumber
60IMLOG10Returnsthebase10logarithmofacomplexnumber
61IMLOG2Returnsthebase2logarithmofacomplexnumber
62IMPOWERReturnsacomplexnumberraisedtoanintegerpower
63IMPRODUCTReturnstheproductoffrom2to29complexnumbers
64IMREALReturnstherealcoefficientofacomplexnumber
65IMSINReturnsthesineofacomplexnumber
66IMSQRTReturnsthesquarerootofacomplexnumber
67IMSUBReturnsthedifferencebetweentwocomplexnumbers
68IMSUMReturnsthesumofcomplexnumbers
69OCT2BINConvertsanoctalnumbertobinary
70OCT2DECConvertsanoctalnumbertodecimal
71OCT2HEXConvertsanoctalnumbertohexadecimal
 
FinancialFunctions
FunctionDescription
72ACCRINTReturnstheaccruedinterestforasecuritythatpaysperiodicinterest
73ACCRINTMReturnstheaccruedinterestforasecuritythatpaysinterestatmaturity
74AMORDEGRCReturnsthedepreciationforeachaccountingperiodbyusingadepreciation
coefficient
75AMORLINCReturnsthedepreciationforeachaccountingperiod
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage10CopyrightMay2010
76COUPDAYBSReturnsthenumberofdaysfromthebeginningofthecouponperiodtothe
settlementdate
77COUPDAYSReturnsthenumberofdaysinthecouponperiodthatcontainsthe
settlementdate
78COUPDAYSNCReturnsthenumberofdaysfromthesettlementdatetothenextcoupon
date
79COUPNCDReturnsthenextcoupondateafterthesettlementdate
80COUPNUMReturnsthenumberofcouponspayablebetweenthesettlementdateand
maturitydate
81COUPPCDReturnsthepreviouscoupondatebeforethesettlementdate
82CUMIPMTReturnsthecumulativeinterestpaidbetweentwoperiods
83CUMPRINCReturnsthecumulativeprincipalpaidonaloanbetweentwoperiods
84DBReturnsthedepreciationofanassetforaspecifiedperiodbyusingthefixed
decliningbalancemethod
85DDBReturnsthedepreciationofanassetforaspecifiedperiodbyusingthe
doubledecliningbalancemethodorsomeothermethodthatyouspecify
86DISCReturnsthediscountrateforasecurity
87DOLLARDEConvertsadollarprice,expressedasafraction,intoadollarprice,expressed
asadecimalnumber
88DOLLARFRConvertsadollarprice,expressedasadecimalnumber,intoadollarprice,
expressedasafraction
89DURATIONReturnstheannualdurationofasecuritywithperiodicinterestpayments
90EFFECTReturnstheeffectiveannualinterestrate
91FVReturnsthefuturevalueofaninvestment
92FVSCHEDULEReturnsthefuturevalueofaninitialprincipalafterapplyingaseriesof
compoundinterestrates
93INTRATEReturnstheinterestrateforafullyinvestedsecurity
94IPMTReturnstheinterestpaymentforaninvestmentforagivenperiod
95IRRReturnstheinternalrateofreturnforaseriesofcashflows
96ISPMTCalculatestheinterestpaidduringaspecificperiodofaninvestment
97MDURATIONReturnstheMacauleymodifieddurationforasecuritywithanassumedpar
valueof$100
98MIRRReturnstheinternalrateofreturnwherepositiveandnegativecashflowsare
financedatdifferentrates
99NOMINALReturnstheannualnominalinterestrate
100NPERReturnsthenumberofperiodsforaninvestment
101NPVReturnsthenetpresentvalueofaninvestmentbasedonaseriesofperiodic
cashflowsandadiscountrate
102ODDFPRICEReturnsthepriceper$100facevalueofasecuritywithanoddfirstperiod
103ODDFYIELDReturnstheyieldofasecuritywithanoddfirstperiod
104ODDLPRICEReturnsthepriceper$100facevalueofasecuritywithanoddlastperiod
105ODDLYIELDReturnstheyieldofasecuritywithanoddlastperiod
106PMTReturnstheperiodicpaymentforanannuity
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage11CopyrightMay2010
107PPMTReturnsthepaymentontheprincipalforaninvestmentforagivenperiod
108PRICEReturnsthepriceper$100facevalueofasecuritythatpaysperiodicinterest
109PRICEDISCReturnsthepriceper$100facevalueofadiscountedsecurity
110PRICEMATReturnsthepriceper$100facevalueofasecuritythatpaysinterestat
maturity
111PVReturnsthepresentvalueofaninvestment
112RATEReturnstheinterestrateperperiodofanannuity
113RECEIVEDReturnstheamountreceivedatmaturityforafullyinvestedsecurity
114SLNReturnsthestraightlinedepreciationofanassetforoneperiod
115SYDReturnsthesumofyears'digitsdepreciationofanassetforaspecified
period
116TBILLEQReturnsthebondequivalentyieldforaTreasurybill
117TBILLPRICEReturnsthepriceper$100facevalueforaTreasurybill
118TBILLYIELDReturnstheyieldforaTreasurybill
119VDBReturnsthedepreciationofanassetforaspecifiedorpartialperiodbyusing
adecliningbalancemethod
120XIRRReturnstheinternalrateofreturnforascheduleofcashflowsthatisnot
necessarilyperiodic
121XNPVReturnsthenetpresentvalueforascheduleofcashflowsthatisnot
necessarilyperiodic
122YIELDReturnstheyieldonasecuritythatpaysperiodicinterest
123YIELDDISCReturnstheannualyieldforadiscountedsecurity;forexample,aTreasurybill
124YIELDMATReturnstheannualyieldofasecuritythatpaysinterestatmaturity
 
InformationFunctions
FunctionDescription
125CELLReturnsinformationabouttheformatting,location,orcontentsofacell
126ERROR.TYPEReturnsanumbercorrespondingtoanerrortype
127INFOReturnsinformationaboutthecurrentoperatingenvironment
128ISBLANKReturnsTRUEifthevalueisblank
129ISERRReturnsTRUEifthevalueisanyerrorvalueexcept#N/A
130ISERRORReturnsTRUEifthevalueisanyerrorvalue
131ISEVENReturnsTRUEifthenumberiseven
132ISLOGICALReturnsTRUEifthevalueisalogicalvalue
133ISNAReturnsTRUEifthevalueisthe#N/Aerrorvalue
134ISNONTEXTReturnsTRUEifthevalueisnottext
135ISNUMBERReturnsTRUEifthevalueisanumber
136ISODDReturnsTRUEifthenumberisodd
137ISREFReturnsTRUEifthevalueisareference
138ISTEXTReturnsTRUEifthevalueistext
139NReturnsavalueconvertedtoanumber
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage12CopyrightMay2010
140NAReturnstheerrorvalue#N/A
141TYPEReturnsanumberindicatingthedatatypeofavalue
17
LogicalFunctions
FunctionDescription
142ANDReturnsTRUEifallofitsargumentsareTRUE
143FALSEReturnsthelogicalvalueFALSE
144IFSpecifiesalogicaltesttoperform
145NOTReversesthelogicofitsargument
146ORReturnsTRUEifanyargumentisTRUE
147TRUEReturnsthelogicalvalueTRUE
 
LookupandReferenceFunctions
FunctionDescription
148ADDRESSReturnsareferenceastexttoasinglecellinaworksheet
149AREASReturnsthenumberofareasinareference
150CHOOSEChoosesavaluefromalistofvalues
151COLUMNReturnsthecolumnnumberofareference
152COLUMNSReturnsthenumberofcolumnsinareference
153GETPIVOTDATAReturnsdatastoredinaPivotTable
154HLOOKUPLooksinthetoprowofanarrayandreturnsthevalueoftheindicatedcell
155HYPERLINKCreatesashortcutorjumpthatopensadocumentstoredonanetwork
server,anintranet,ortheInternet
156INDEXUsesanindextochooseavaluefromareferenceorarray
157INDIRECTReturnsareferenceindicatedbyatextvalue
158LOOKUPLooksupvaluesinavectororarray
159MATCHLooksupvaluesinareferenceorarray
160OFFSETReturnsareferenceoffsetfromagivenreference
161ROWReturnstherownumberofareference
162ROWSReturnsthenumberofrowsinareference
163RTDRetrievesrealtimedatafromaprogramthatsupportsCOM
automation(Automation:Awaytoworkwithanapplication'sobjectsfrom
anotherapplicationordevelopmenttool.FormerlycalledOLEAutomation,
AutomationisanindustrystandardandafeatureoftheComponentObject
Model(COM).)
164TRANSPOSEReturnsthetransposeofanarray
165VLOOKUPLooksinthefirstcolumnofanarrayandmovesacrosstherowtoreturnthe
valueofacell
 
MathandTrigonometryFunctions
FunctionDescription
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage13CopyrightMay2010
166ABSReturnstheabsolutevalueofanumber
167ACOSReturnsthearccosineofanumber
168ACOSHReturnstheinversehyperboliccosineofanumber
169ASINReturnsthearcsineofanumber
170ASINHReturnstheinversehyperbolicsineofanumber
171ATANReturnsthearctangentofanumber
172ATAN2Returnsthearctangentfromx‐andycoordinates
173ATANHReturnstheinversehyperbolictangentofanumber
174CEILINGRoundsanumbertothenearestintegerortothenearestmultipleof
significance
175COMBINReturnsthenumberofcombinationsforagivennumberofobjects
176COSReturnsthecosineofanumber
177COSHReturnsthehyperboliccosineofanumber
178DEGREESConvertsradianstodegrees
179EVENRoundsanumberuptothenearesteveninteger
180EXPReturnseraisedtothepowerofagivennumber
181FACTReturnsthefactorialofanumber
182FACTDOUBLEReturnsthedoublefactorialofanumber
183FLOORRoundsanumberdown,towardzero
184GCDReturnsthegreatestcommondivisor
185INTRoundsanumberdowntothenearestinteger
186LCMReturnstheleastcommonmultiple
187LNReturnsthenaturallogarithmofanumber
188LOGReturnsthelogarithmofanumbertoaspecifiedbase
189LOG10Returnsthebase10logarithmofanumber
190MDETERMReturnsthematrixdeterminantofanarray
191MINVERSEReturnsthematrixinverseofanarray
192MMULTReturnsthematrixproductoftwoarrays
193MODReturnstheremainderfromdivision
194MROUNDReturnsanumberroundedtothedesiredmultiple
195MULTINOMIALReturnsthemultinomialofasetofnumbers
196ODDRoundsanumberuptothenearestoddinteger
197PIReturnsthevalueofpi
198POWERReturnstheresultofanumberraisedtoapower
199PRODUCTMultipliesitsarguments
200QUOTIENTReturnstheintegerportionofadivision
201RADIANSConvertsdegreestoradians
202RANDReturnsarandomnumberbetween0and1
203RANDBETWEENReturnsarandomnumberbetweenthenumbersyouspecify
204ROMANConvertsanarabicnumeraltoroman,astext
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage14CopyrightMay2010
205ROUNDRoundsanumbertoaspecifiednumberofdigits
206ROUNDDOWNRoundsanumberdown,towardzero
207ROUNDUPRoundsanumberup,awayfromzero
208SERIESSUMReturnsthesumofapowerseriesbasedontheformula
209SIGNReturnsthesignofanumber
210SINReturnsthesineofthegivenangle
211SINHReturnsthehyperbolicsineofanumber
212SQRTReturnsapositivesquareroot
213SQRTPIReturnsthesquarerootof(number*pi)
214SUBTOTALReturnsasubtotalinalistordatabase
215SUMAddsitsarguments
216SUMIFAddsthecellsspecifiedbyagivencriteria
217SUMPRODUCTReturnsthesumoftheproductsofcorrespondingarraycomponents
218SUMSQReturnsthesumofthesquaresofthearguments
219SUMX2MY2Returnsthesumofthedifferenceofsquaresofcorrespondingvaluesintwo
arrays
220SUMX2PY2Returnsthesumofthesumofsquaresofcorrespondingvaluesintwoarrays
221SUMXMY2Returnsthesumofsquaresofdifferencesofcorrespondingvaluesintwo
arrays
222TANReturnsthetangentofanumber
223TANHReturnsthehyperbolictangentofanumber
224TRUNCTruncatesanumbertoaninteger
StatisticalFunctions
FunctionDescription
225AVEDEVReturnstheaverageoftheabsolutedeviationsofdatapointsfromtheir
mean
226AVERAGEReturnstheaverageofitsarguments
227AVERAGEAReturnstheaverageofitsarguments,includingnumbers,text,andlogical
values
228BETADISTReturnsthebetacumulativedistributionFunction
229BETAINVReturnstheinverseofthecumulativedistributionFunctionforaspecified
betadistribution
230BINOMDISTReturnstheindividualtermbinomialdistributionprobability
231CHIDISTReturnstheonetailedprobabilityofthechisquareddistribution
232CHIINVReturnstheinverseoftheonetailedprobabilityofthechisquared
distribution
233CHITESTReturnsthetestforindependence
234CONFIDENCEReturnstheconfidenceintervalforapopulationmean
235CORRELReturnsthecorrelationcoefficientbetweentwodatasets
236COUNTCountshowmanynumbersareinthelistofarguments
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage15CopyrightMay2010
237COUNTACountshowmanyvaluesareinthelistofarguments
238COUNTBLANKCountsthenumberofblankcellswithinarange
239COUNTIFCountsthenumberofnonblankcellswithinarangethatmeetthegiven
criteria
240COVARReturnscovariance,theaverageoftheproductsofpaireddeviations
241CRITBINOMReturnsthesmallestvalueforwhichthecumulativebinomialdistributionis
lessthanorequaltoacriterionvalue
242DEVSQReturnsthesumofsquaresofdeviations
243EXPONDISTReturnstheexponentialdistribution
244FDISTReturnstheFprobabilitydistribution
245FINVReturnstheinverseoftheFprobabilitydistribution
246FISHERReturnstheFishertransformation
247FISHERINVReturnstheinverseoftheFishertransformation
248FORECASTReturnsavaluealongalineartrend
249FREQUENCYReturnsafrequencydistributionasaverticalarray
250FTESTReturnstheresultofanFtest
251GAMMADISTReturnsthegammadistribution
252GAMMAINVReturnstheinverseofthegammacumulativedistribution
253GAMMALNReturnsthenaturallogarithmofthegammaFunction,Γ(x)
254GEOMEANReturnsthegeometricmean
255GROWTHReturnsvaluesalonganexponentialtrend
256HARMEANReturnstheharmonicmean
257HYPGEOMDISTReturnsthehypergeometricdistribution
258INTERCEPTReturnstheinterceptofthelinearregressionline
259KURTReturnsthekurtosisofadataset
260LARGEReturnsthekthlargestvalueinadataset
261LINESTReturnstheparametersofalineartrend
262LOGESTReturnstheparametersofanexponentialtrend
263LOGINVReturnstheinverseofthelognormaldistribution
264LOGNORMDISTReturnsthecumulativelognormaldistribution
265MAXReturnsthemaximumvalueinalistofarguments
266MAXAReturnsthemaximumvalueinalistofarguments,includingnumbers,text,
andlogicalvalues
267MEDIANReturnsthemedianofthegivennumbers
268MINReturnstheminimumvalueinalistofarguments
269MINAReturnsthesmallestvalueinalistofarguments,includingnumbers,text,and
logicalvalues
270MODEReturnsthemostcommonvalueinadataset
271NEGBINOMDISTReturnsthenegativebinomialdistribution
272NORMDISTReturnsthenormalcumulativedistribution
273NORMINVReturnstheinverseofthenormalcumulativedistribution
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage16CopyrightMay2010
274NORMSDISTReturnsthestandardnormalcumulativedistribution
275NORMSINVReturnstheinverseofthestandardnormalcumulativedistribution
276PEARSONReturnsthePearsonproductmomentcorrelationcoefficient
277PERCENTILEReturnsthekthpercentileofvaluesinarange
278PERCENTRANKReturnsthepercentagerankofavalueinadataset
279PERMUTReturnsthenumberofpermutationsforagivennumberofobjects
280POISSONReturnsthePoissondistribution
281PROBReturnstheprobabilitythatvaluesinarangearebetweentwolimits
282QUARTILEReturnsthequartileofadataset
283RANKReturnstherankofanumberinalistofnumbers
284RSQReturnsthesquareofthePearsonproductmomentcorrelationcoefficient
285SKEWReturnstheskewnessofadistribution
286SLOPEReturnstheslopeofthelinearregressionline
287SMALLReturnsthekthsmallestvalueinadataset
288STANDARDIZEReturnsanormalizedvalue
289STDEVEstimatesstandarddeviationbasedonasample
290STDEVAEstimatesstandarddeviationbasedonasample,includingnumbers,text,and
logicalvalues
291STDEVPCalculatesstandarddeviationbasedontheentirepopulation
292STDEVPACalculatesstandarddeviationbasedontheentirepopulation,including
numbers,text,andlogicalvalues
293STEYXReturnsthestandarderrorofthepredictedyvalueforeachxinthe
regression
294TDISTReturnstheStudent'stdistribution
295TINVReturnstheinverseoftheStudent'stdistribution
296TRENDReturnsvaluesalongalineartrend
297TRIMMEANReturnsthemeanoftheinteriorofadataset
298TTESTReturnstheprobabilityassociatedwithaStudent'sttest
299VAREstimatesvariancebasedonasample
300VARAEstimatesvariancebasedonasample,includingnumbers,text,andlogical
values
301VARPCalculatesvariancebasedontheentirepopulation
302VARPACalculatesvariancebasedontheentirepopulation,includingnumbers,text,
andlogicalvalues
303WEIBULLReturnstheWeibulldistribution
304ZTESTReturnstheonetailedprobabilityvalueofaztest
 
TextFunctions
FunctionDescription
305ASCChangesfullwidth(doublebyte)Englishlettersorkatakanawithina
characterstringtohalfwidth(singlebyte)characters
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage17CopyrightMay2010
306BAHTTEXTConvertsanumbertotext,usingtheß(baht)currencyformat
307CHARReturnsthecharacterspecifiedbythecodenumber
308CLEANRemovesallnonprintablecharactersfromtext
309CODEReturnsanumericcodeforthefirstcharacterinatextstring
310CONCATENATEJoinsseveraltextitemsintoonetextitem
311DOLLARConvertsanumbertotext,usingthe$(dollar)currencyformat
312EXACTCheckstoseeiftwotextvaluesareidentical
313FIND,FINDBFindsonetextvaluewithinanother(casesensitive)
314FIXEDFormatsanumberastextwithafixednumberofdecimals
315JISChangeshalfwidth(singlebyte)Englishlettersorkatakanawithinacharacter
stringtofullwidth(doublebyte)characters
316LEFT,LEFTBReturnstheleftmostcharactersfromatextvalue
317LEN,LENBReturnsthenumberofcharactersinatextstring
318LOWERConvertstexttolowercase
319MID,MIDBReturnsaspecificnumberofcharactersfromatextstringstartingatthe
positionyouspecify
320PHONETICExtractsthephonetic(furigana)charactersfromatextstring
321PROPERCapitalizesthefirstletterineachwordofatextvalue
322REPLACE,
REPLACEB
Replacescharacterswithintext
323REPTRepeatstextagivennumberoftimes
324RIGHT,RIGHTBReturnstherightmostcharactersfromatextvalue
325SEARCH,
SEARCHB
Findsonetextvaluewithinanother(notcasesensitive)
326SUBSTITUTESubstitutesnewtextforoldtextinatextstring
327TConvertsitsargumentstotext
328TEXTFormatsanumberandconvertsittotext
329TRIMRemovesspacesfromtext
330UPPERConvertstexttouppercase
331VALUEConvertsatextargumenttoanumber
 
ExternalFunctions
FunctionDescription
332EUROCONVERTConvertsanumbertoeuros,convertsanumberfromeurostoaeuro
membercurrency,orconvertsanumberfromoneeuromembercurrencyto
anotherbyusingtheeuroasanintermediary(triangulation)
333SQL.REQUESTConnectswithanexternaldatasourceandrunsaqueryfromaworksheet,
thenreturnstheresultasanarraywithouttheneedformacroprogramming

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage18CopyrightMay2010
Chapter2
The=IFFunction

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage19CopyrightMay2010
=IF
The“IF”functionisthemostpowerfulofallfunctionsnotjustinExcel,butinany
programminglanguage.Commonlyreferredtoas“ConditionalProgramming”,itistheIF
functionthatenablesustointroducelogicalthinkingintoanyprogram.Thisfunctionisalso
referredtoasthe“IfThenElse”command,“conditionalexpressions”,or“PropositionalLogic”.
ThefollowingWikisexplainsthisconceptinmoredetail:
http://en.wikipedia.org/wiki/Conditional_(programming).
http://en.wikipedia.org/wiki/Logical_conditional#Conditional_statements
ThecleverCPAcanusetheIFFunctiontobuildelaborateExceltemplatesandfinancialmodels
containinganalmostunlimitedamountofsophisticatedprogramming.Presentedbeloware
severalexamplestohelpyoubetterunderstandtheapplicationofthispowerfultool.
SimpleIF‐TheIFfunctionreturnsonevalueifaconditionyouspecifyevaluatestoTRUE,and
anothervalueifthatconditionevaluatestoFALSE.Presentedbelowisasimpleexample:
SimpleIFwithCalculationPresentedbelowisanexamplethatisalittlemorecomplex:
SimpleIFLargerExample‐PresentedbelowisyetanotherIFexampleonalittlelargerscale
thisexampleshowshowonemightapplytheIFfunctiontoevaluatebudgetversusactual
comparisons.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage20CopyrightMay2010
SimpleIFwithDropDown‐Inthefollowingexample,theIFfunctionischeckingtoseeifthey
havesignedupforinsurance.Iftheyhave,thedeductionamountisentered.


ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage21CopyrightMay2010
SimpleIFwithCalculation‐ThenextIFfunctionexampleisdeterminingeachemployees
earnedvacationdays.Iftheyhaveworkedformorethanayear,theyhaveearned5vacation
daysplusonedayforeachadditionalfullyear. 


NestedIFFunctions‐Inthissample,therearefourpossibilitiesforbonuses.
IFFunctionwithLogicalORArgument‐TeamsAandCmeetonTuesday,TeamsBandDmeet
onThursday.WewanttolistthemeetingdaysincolumnD.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage22CopyrightMay2010
MoreComplexIFFunctionExample‐ThefollowingIFexampleshowsamorecomplex
applicationinwhichtheuserselectsataxpayerstatusfromadropdownlist,whichthen
retrievesthecorrecttaxbase,threshold,andincrementaltaxratestobeusedincalculatingtax.
ThisexampleillustrateshowaCPAmightprepareanincomestatementtemplatethat
calculatestheappropriateamountoftaxesasnetincomeandthetaxpayerstatuschanges.
Essentiallythetemplatecalculatesthecorrecttaxgivenallfourpossibletaxpayerstatuses,and
theIFstatementsareusedtoselectthecorrectanswersbasedonthetaxpayerstatusselected.
Keepinmindthatdespitethemanyaccoladesmentionedabove,theIFFunctionisnotalways
thebestsolution.Forexample,theVLOOKUPwouldbeabetterandeasierfunctiontouseto
extractdatafromalistasshowninthenestedIFFunctionafewexamplesabove.ManyExcel
Functionsalsoprovidebuiltin“IFThenElse”functionality.
KeyPointersforUsingtheIFFunction:
1. NestingYoucanembedupto8nestedIFfunctionsinasingleformulainExcel2003,andupto
64IFnestedfunctionsinExcel2007.
2. AND,ORYoucanusetheANDand/orORoperatortoaddmoreconditionstoanIFFunction.
3. VariationsofIF‐ExceloffersseveralvariationsoftheIFfunctionasfollows:COUNTIF,
COUNTIFS,SUMIF,SUMIFS.
4. EvaluatinganIFErrorSincetheIFstatementprovidesonlyatrueorfalseresult,thereisno
waytoevaluateanIFFunctiontoERROR.Ifyoureceiveanerror,youwrotetheformulawrong.
5. TheNullSet‐TheDoubleQuotesistheNullSet,orabsenceofavalue.Forexample,when
testingforaZerobalanceortestingforablankcell,thefollowingIFfunctionswouldapply:
a. =IF(A1=0,”ZERO”,””)
b. =IF(A1=””,”Blank”,””)
(ExcelalsoprovidesanISBLANKFunctionthatwouldalsowork.)
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage23CopyrightMay2010
Chapter3
UsingFunctionsTo
Crunch&CleanData

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage24CopyrightMay2010
CleaningDataUsingFunctions
CPAsoftenreceiveorretrievedatafrommanysourcesinawidevarietyofformatssuchasText
orCSVformats.Youdon'talwayshavecontrolovertheformatandtypeofdatathatyouimport
fromanexternaldatasource,suchasadatabase,textfile,oraWebpage.Beforeyoucan
analyzethedata,youoftenneedtocleanitup.Fortunately,OfficeExcelhasmanyfeaturesto
helpyougetdatainthepreciseformatthatyouwant.Sometimes,thetaskisstraightforward
andthereisaspecificfeaturethatdoesthejobforyou.
Forexample,youcaneasilyuseSpellCheckertocleanupmisspelledwordsincolumnsthat
containcommentsordescriptions.Or,ifyouwanttoremoveduplicaterows,youcanquicklydo
thisbyusingtheRemoveDuplicatesdialogbox.Atothertimes,youmayneedtomanipulate
oneormorecolumnsbyusingaformulatoconverttheimportedvaluesintonewvalues.
Forexample,ifyouwanttoremovetrailingspaces,youcancreateanewcolumntocleanthe
databyusingaformula,fillingdownthenewcolumn,convertingthatnewcolumn'sformulas
tovalues,andthenremovingtheoriginalcolumn.Excelprovidesmanyfunctionstohelpyou
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
1. ImportingDataintoExcelOfcourseexcelopensupexcelfiles,butwhathappenswhen
youattempttoopendatathatisnotcontainedinanExcelformat?TheansweristhatExcel
automaticallyimportsthatdataontheflyanddisplaysaImportWizardtohelpyou
completetheprocess.TheTextImportWizardexaminesthetextfilethatyouareimporting
andhelpsyouimportthedatathewaythatyouwant.TostarttheTextImportWizard,on
theDatatab,intheGetExternalDatagroup,clickFromText.Then,intheImportTextFile
dialogbox,doubleclickthetextfilethatyouwanttoimport.Thefollowingdialogboxwill
bedisplayed:
Ifitemsinthetextfileareseparatedbytabs,colons,semicolons,spaces,orother
characters,selectDelimited.Ifalloftheitemsineachcolumnarethesamelength,select
Fixedwidth.Instep3,clicktheAdvancedbuttontospecifythatoneormorenumericvalues
maycontainatrailingminussign.Alsoclickthedesireddataformatforeachcolumntobe
imported.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage26CopyrightMay2010
2. TexttoColumnsTheTexttoColumnscommandlocatedontheDataRibbonworksexactly
thesamewayasdescribedabovetheusersimplylaunchesittoconvertdatawithinan
existingworksheet.
3. RemovingDuplicateRows‐Duplicaterowsareacommonproblemwhenyouimportdata.
YoucanidentifyandremoveduplicaterowsbyusingtheData,AdvancedFilter,Unique
RecordsOnlytoolasshowinthescreenbelow.
4. FindandReplaceTextThistoolcanbeusedtoidentifyandremoveleadingstring,suchas
alabelfollowedbyacolonandspace,orasuffix,suchasaparentheticphraseattheendof
thestringthatisobsoleteorunnecessary.Youcandothisbyfindinginstancesofthattext
andthenreplacingitwithnotextorothertext.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage27CopyrightMay2010
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.
ChangingTheCaseOfTextYoucanuseoneormoreofthethreeCasefunctionsto
converttexttolowercaseletters,suchasemailaddresses,uppercaseletters,suchas
productcodes,orpropercase,suchasnamesorbooktitles.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage28CopyrightMay2010
6. =UPPER‐Convertstexttouppercaseletters.
7. =LOWER‐Convertsalluppercaselettersinatextstringtolowercaseletters.
8. =PROPER‐Capitalizesthefirstletterinatextstringandanyotherlettersintextthatfollowany
characterotherthanaletter.Convertsallotherletterstolowercaseletters.
MergingAndSplittingColumns‐Acommontaskafterimportingdatafromanexternaldata
sourceistoeithermergetwoormorecolumnsintoone,orsplitonecolumnintotwoor
morecolumns.Forexample,youmaywanttosplitacolumnthatcontainsafullnameintoa
firstandlastname.Or,youmaywanttosplitacolumnthatcontainsanaddressfieldinto
separatestreet,city,region,andpostalcodecolumns.Thereversemayalsobetrue.
Presentedbelowarefunctionsthattohelpyouaccomplishthesetasks:
9. =FINDUseReturnsthestartingpositionofacharacter,stringofcharactersorwordwithacell.
Findiscasesensitive.
10. =SEARCHReturnsthestartingpositionofacharacter,stringofcharactersorwordwithacell.
Searchisnotcasesensitive.
11. =LENDisplaysthelengthornumberofcharactersinacell.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage29CopyrightMay2010
12. =SUBSTITUTEReplacesacharacterorcharacterswithacharacterorcharactersthatyouspecify.
13. =REPLACE‐Replacesacharacterorcharacterswithacharacterorcharactersthatyouspecify.
14. =LEFTExtractsthespecifiednumberofcharactersfromacell,startingfromtheleft.
15. =MIDExtractsthespecifiednumberofcharactersfromacell,startingfromsomewhereinthe
middleofthecell.
16. =RIGHTExtractsthespecifiednumberofcharactersfromacell,startingfromtheright.
17. =ValueConvertstexttovaluessothedatacanbeadded,subtracted,multiplied,dividedor
referencedinafunction.
18. =CONCATENATE‐Joinstwoormoretextstringsintoonetextstring.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage30CopyrightMay2010
Variationsofthesefunctionsthatareusedwhenworkingwithforeignlanguages:
=FINDBUsethiswhenworkingwithforeigncharacterslikethese("," )
=SEARCHBUsethiswhenworkingwithforeigncharacterslikethese("," )
=REPLACEBUsethiswhenworkingwithforeigncharacterslikethese("," )
=LEFTBUsethiswhenworkingwithforeigncharacterslikethese("," )
=RIGHTBUsethiswhenworkingwithforeigncharacterslikethese("," )
=LENBUsethiswhenworkingwithforeigncharacterslikethese("," )
=MIDBUsethiswhenworkingwithforeigncharacterslikethese("," )
CleaningText(RemovingSpacesAndNonprintingCharactersFromText)‐Sometimes
textvaluescontainleading,trailing,ormultipleembeddedspacecharacters(Unicode
charactersetvalues32and160),ornonprintingcharacters(Unicodecharactersetvalues0
to31,127,129,141,143,144,and157).Thesecharacterscansometimescauseunexpected
resultswhenyousort,filter,orsearch.Forexample,intheexternaldatasource,usersmay
maketypographicalerrorsbyinadvertentlyaddingextraspacecharacters,orimportedtext
datafromexternalsourcesmaycontainnonprintingcharactersthatareembeddedinthe
text.Becausethesecharactersarenoteasilynoticed,theunexpectedresultsmaybe
difficulttounderstand.Followingisalistoffunctionsyoucanusetoremovethese
unwantedcharacters:
19. =TEXT‐Convertsavaluetotextinaspecificnumberformat.
20. =TRIM‐Removesthe7bitASCIIspacecharacter(value32)fromtext.
21. =CLEAN‐Removesthefirst32nonprintingcharactersinthe7bitASCIIcode(values0
through31)fromtext.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage31CopyrightMay2010
22. =FIXED‐Roundsanumbertothespecifiednumberofdecimals,formatsthenumberin
decimalformatbyusingaperiodandcommas,andreturnstheresult.
23. =DOLLAR‐Convertsanumbertotextformatandappliesacurrencysymbol.
24. =CODE‐Returnsanumericcodeforthefirstcharacterinatextstring.
FixingDatesandTimes‐Therearemanydifferentdateformats,andthesevariedformats
maybeconfusedwithnumberedpartcodesorotherstringsthatcontainslashmarksor
hyphens,datesandtimesoftenneedtobeconvertedandreformatted.Presentedbelowis
alistoffunctionsthathelpyouaccomplishthistask.
25. =DATE‐Returnsthesequentialserialnumberthatrepresentsaparticulardate.Ifthecellformat
wasGeneralbeforethefunctionwasentered,theresultisformattedasadate.
26. =DATEVALUE‐Convertsadaterepresentedbytexttoaserialnumber.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage32CopyrightMay2010
27. =TIME‐ Returnsthedecimalnumberforaparticulartime.IfthecellformatwasGeneral
beforethefunctionwasentered,theresultisformattedasadate.
28. =TIMEVALUE‐ Returnsthedecimalnumberofthetimerepresentedbyatextstring.The
decimalnumberisavaluerangingfrom0(zero)to0.99999999,representingthetimes
from0:00:00(12:00:00AM)to23:59:59(11:59:59P.M.).
TransformingAndRearrangingColumnsAndRows‐Mostoftheanalysisandformatting
featuresinOfficeExcelassumethatthedataexistsinasingle,flattwodimensionaltable.
Sometimesyoumaywanttomaketherowsbecomecolumns,andthecolumnsbecome
rows.Atothertimes,dataisnotevenstructuredinatabularformat,andyouneedawayto
transformthedatafromanontabulartoatabularformat.Thefollowingfunctioncanhelp
youachievethisgoal:
29. =TRANSPOSE‐Returnsaverticalrangeofcellsasahorizontalrange,orviceversa.
30. DataFillInTrickAclevertrickforfillinginmissingdatacanbeaccomplishedusingtheGOTO,
Special,Blankscommand.Hereishowitworks.Thistrickworkswellwhenyouhavealargevolume
ofdatabutdescriptionsarenotprovidedforeveryrow,asshownintheexamplebelow:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage33CopyrightMay2010
Startbyenteringasimpleformulareferencingthedatalabelintheabovecell,justlikethis:
a. Nextcopythatformula...
b. HighlighttheentirerangecontainingdatalabelsincolumnsAandB.columns...
c. PresstheF5keytolaunchtheGoTodialogbox...
d. SelecttheOptionsBox...
e. Clickonthe“Blanks”radiobutton...
f. PressEnter...
g. Paste.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage34CopyrightMay2010
Thisactionwillcausealldatalabelstorepeatintheemptycellsbeneath.Next:
h. CopycolumnsA&B...
i. PasteSpecialasvaluestoconverttheformulastotextbaseddatalabels...
j. Youarenowreadytosort,filter,subtotalandpivotyourdata.
FetchingData‐Occasionally,databaseadministratorsuseOfficeExceltofindandcorrect
matchingerrorswhentwoormoretablesarejoined.Thismightinvolvereconcilingtwo
tablesfromdifferentworksheets,forexample,toseeallrecordsinbothtablesorto
comparetablesandfindrowsthatdon'tmatch.
31. =VLOOKUP‐Searchesforavalueinthefirstcolumnofatablearrayandreturnsavaluein
thesamerowfromanothercolumninthetablearray.Forexample,considertheexample
belowwhichusesa=VLOOKUPfunctiontocalculatetheappropriateamountoftaxdue
basedontheIRSrateschedule.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage35CopyrightMay2010
AstheIncomestatementshownintheshadedareaisupdated,theresultingtaxable
incomeamountisreferencedinCellF13.Next,3VLOOKUPfunctionspulltheappropriate
rate,baseandthresholdinformationfromtheratescheduletobeusedincalculating
incometax.Oncecalculated,theresultingtaxisreferencedbacktotheincomestatement
forthepurposesofcomputingNetincomeAftertaxes.
KeypointstoConsiderwhenUsingVLOOKUP:
a. Ifyouarelookingupbasedontext,thefirstcolumncontaininglookup
valuesmustbesortedalphabeticallyindescendingorderelseitwillnot
workproperly.
b. Ifyouarelookingupbasedontext,youmusthaveanexactmatchbetween
thelookupvalueandthetablearrayvalue.
c. Ifyouarelookingupbasedonvalues,thefirstcolumncontaininglookup
valuesmustbesortednumericallyindescendingorderelseitwillnotwork
properly.
d. Ifyouarelookingupbasedonvalues,thenExcelwillchoosetheclosest
valuewithoutgoingover.Forexample,ifthelookupvalueis198,000and
thetablearraycontainsvaluesof100,000and200,000,thenexcelwill
choose100,000because200,000goesoverorexceeds198,000.(Itmightbe
helpfultothinkbacktotheoldBobbarkergameshowthePriceisRight.)
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage36CopyrightMay2010
32. =HLOOKUP‐Searchesforavalueinthetoprowofatableoranarrayofvalues,andthen
returnsavalueinthesamecolumnfromarowyouspecifyinthetableorarray.
33. =INDEX‐Returnsavalueorthereferencetoavaluefromwithinatableorrange.Thereare
twoformsoftheINDEXfunction:thearrayformandthereferenceform.
34. =MATCH‐Returnstherelativepositionofaniteminanarraythatmatchesaspecified
valueinaspecifiedorder.UseMATCHinsteadofoneoftheLOOKUPfunctionswhenyou
needthepositionofaniteminarangeinsteadoftheitemitself.
35. =OFFSET‐Returnsareferencetoarangethatisaspecifiednumberofrowsandcolumns
fromacellorrangeofcells.Thereferencethatisreturnedcanbeasinglecellorarangeof
cells.Youcanspecifythenumberofrowsandthenumberofcolumnstobereturned.
36. DataCleaningwithMacros‐Toperiodicallycleanthesamedatasource,considerrecording
amacroorwritingcodetoautomatetheentireprocess.Therearealsoanumberof
externaladdinswrittenbythirdpartyvendors,listedintheThirdpartyproviderssection,
thatyoucanconsiderusingifyoudon'thavethetimeorresourcestoautomatetheprocess
onyourown.
37. RAND(),RANDBETWEEN(),ROUND()InExcel2003,RANDBETWEENisnotinthe
standardEXCELinstallationbutiftheanalysistoolpackisinstalledandtheaddinactivated
itisanextremelyusefulfunction.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage37CopyrightMay2010
38. InformationalFunctions
CELL(info_type,reference)‐Info_type isatextvaluethatspecifieswhattypeofcell
informationyouwant.Thefollowinglistshowsthepossiblevaluesofinfo_typeandthe
correspondingresults.
Info_typeReturns
"address"Referenceofthefirstcellinreference,astext.
"col"Columnnumberofthecellinreference.
"color"1ifthecellisformattedincolorfornegativevalues;otherwisereturns0
(zero).
"contents"Valueoftheupperleftcellinreference;notaformula.
"filename"Filename(includingfullpath)ofthefilethatcontainsreference,astext.
Returnsemptytext("")iftheworksheetthatcontainsreferencehasnotyet
beensaved.
"format"Textvaluecorrespondingtothenumberformatofthecell.Thetextvalues
forthevariousformatsareshowninthefollowingtable.Returns""atthe
endofthetextvalueifthecellisformattedincolorfornegativevalues.
Returns"()"attheendofthetextvalueifthecellisformattedwith
parenthesesforpositiveorallvalues.
"parentheses"1ifthecellisformattedwithparenthesesforpositiveorallvalues;
otherwisereturns0.
"prefix"Textvaluecorrespondingtothe"labelprefix"ofthecell.Returnssingle
quotationmark(')ifthecellcontainsleftalignedtext,doublequotation
mark(")ifthecellcontainsrightalignedtext,caret(^)ifthecellcontains
centeredtext,backslash(\)ifthecellcontainsfillalignedtext,andempty
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage38CopyrightMay2010
text("")ifthecellcontainsanythingelse.
"protect"0ifthecellisnotlocked,and1ifthecellislocked.
"row"Rownumberofthecellinreference.
"type"Textvaluecorrespondingtothetypeofdatainthecell.Returns"b"for
blankifthecellisempty,"l"forlabelifthecellcontainsatextconstant,and
"v"forvalueifthecellcontainsanythingelse.
"width"Columnwidthofthecellroundedofftoaninteger.Eachunitofcolumn
widthisequaltothewidthofonecharacterinthedefaultfontsize.
Referencethecellthatyouwantinformationabout.Ifomitted,informationspecifiedin
info_typeisreturnedforthelastcellthatwaschanged.Thefollowinglistdescribesthetext
valuesCELLreturnswheninfo_typeis"format",andreferenceisacellformattedwitha
builtinnumberformat.
IftheMicrosoftExcelformatisCELLreturns
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"
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage39CopyrightMay2010
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.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage40CopyrightMay2010
ThirdPartySolutionsIncaseExcelsbuiltinfunctionsarenotsufficienttomeetyour
needs,followingisapartiallistofthirdpartyprovidersthathaveproductsthatareusedto
cleandatainavarietyofways.
ProviderProduct
AddinExpressLtd.AdvancedFind&Replace,MergeCells
Wizard
AddIns.comDuplicateFinder
AddinToolsAddinToolsAssist
CDXZipStream
Click2ConvertConvertsPDFtoExcelformats
DigDBAddinsforExcel®
JKPApplicationDevelopmentFlexfindforExcel
JWalk&Associates,Inc.PowerUtilityPakVersion7
OfficeAssistanceLLCSimilarDataFinderforExcel®
PAToolsPAToolsAdvancedFindReplace
PDF2XLConvertsPDFfilestoExcelFormats
SpinnakerSoftwareSolutionsSpinnakerDBtoolsforExcel
VonnixExcelPowerExpander4.6
WinPureListCleanerLite
ListCleanerPro
CleanandMatch2007
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage41CopyrightMay2010
Chapter4
DataCommands
TheHeart&SoulOfExcel

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage42CopyrightMay2010
TheDataMenu‐PerhapsthepartsofExcelthatareofmostvaluetoCPAs,butleastused
byCPAsaretheDatacommandsfoundundertheDatamenuinExcel2003andearlier,and
onthedataRibboninExcel2007.Thesecommandsareshownbelow,andwewill
concentratethenexthourtostudyingthesecommands.
DataSortTheSorttooldoesexactlywhatitimpliesitsortsanddata.Keysorting
pointsareasfollows:
1. ContiguousData‐The“AtoZ”sortingtoolcansortlargematrixofdata
automaticallyaslongasthedataiscontiguous.Inotherwords,yourdatashould
containnoblankcolumns,noblankrows,andthecolumnsmustallbelabeled.
OnlythenwillExcelalwayscorrectlyselecttheentirematrixforsorting.
2. AtoZButton‐Simplyplacethecursorinthedesiredcolumnforsorted,and
presstheAtoZorZtoAbuttonasthecasemaybe.Excelwillautomaticallysort
allcontinuouscolumnsthathaveheadingsandallcontiguousrowsfromthetop
rowundertheheadinglabelsdowntothelastrowintheselectedcolumnthat
containsdata.(Note‐Ifyouaccidentlyselect2cellsinsteadofjustone,your
resultswillnotbecorrect.)
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage43CopyrightMay2010
3. Sortby64Columns‐The“Sort”toolisdramaticallyenhancedinExcel2007asit
nowprovidestheabilitytosortbyupto64columns,insteadofjust3columns.
Presentedbelowisadialogboxwhichshowsthisexpandedfunctionality.
4. SortLefttoRightExcelhasalwaysprovidedtheabilitytosortlefttoright.Todo
so,selecttheoptionsboxintheSortDialogboxandclickthecheckboxlabeled
“SortlefttoRight”asshownbelow.
5. SortbyColorExcel2007nowprovidestheabilitytosortbyfontcolororbycell
color,orboth.Thisishandyinmanyways.SometimesCPAsusecolortotagor
markcertaincells‐andlaterfinditusefultobeabletosortbythosemarkings.In
othersituationsCPAsuseconditionalformattingtoapplycolortocellsusinga
widevarietyofrules.ThereafterExcelcansortthedatabasedontheresulting
colors.Thesortbycoloroptionsareshownbelow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage44CopyrightMay2010

Tobeaccurate,itwaspossibletosortbycolorinExcel2003.Toaccomplishthis
task,youneededtousethe=CELLfunctioninordertoidentifyinformationabout
agivencellsuchasthecellcolororfontcolor.Thereafter,theresultsofthat
functioncouldbeusedtosortrowswhicheffectivelymeansthatyoucansort
bycolorinExcel2003butittakesabitmoreeffort.
6. SortByCustomListAnothersortingcapabilityinExcelistheabilitytosortby
CustomList.Forexample,assumeaCPAfirmhastenpartners,andtheManaging
partnerpreferstobeshownatthetopofthelist,andtheremainingPartners
basedonseniority.Inthiscase,youcouldcreateaCustomListintheexcel
Optionsdialogboxlistingthepartnersinthedesiredorder,andthensortfuture
reportsbasedonthatorder.
Perhapsabetterexampleuseofthisfeaturewouldbetocreateanonalphabetic
customlistofyourchartofaccounts,andthensorttransactionstoproducea
generalledgerinchartofaccountorderevenifyourpreferredchartofaccounts
isnotalphabetical.thepartnersenioritydoesnotmatchthealphabeticnames,
norany
FilteringData‐UsingAutoFiltertofilterdataallowsyoutoviewasubsetofyourdata
inarangeofcellsortable.Onceyouhavefilteredthedata,youcanapplyadditionalfilters
tofurtherrefineyourdataview.Whenyouaredone,youcanclearafiltertoonceagain
redisplayallofthedata.Tousethistool,startwithanylistofdataandturnonthe
AutoFiltertool.Thenpositionyourcursorinthecolumnyouwanttofilterandusethedrop
downarrowstoapplyyourfiltersasshowninthescreenbelow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage45CopyrightMay2010
Oncethefiltersareapplied,youwillseeasubsetyourdata.Forexample,thescreen
presentedbelowshowsfiltereddataforonlyMaconandSavannahproperties.
Asfiltersareapplied,asmallfunnelappearsinthedropdownarrowbuttontoindicatethat
afilterhasbeenapplied.Youcanapplyfiltersformultiplecolumnssimultaneously.
KeyPointsConcerningTheAutoFilterCommand:
1. ContiguousDataTheAutoFiltertoolsworksbestwhenyouareworkingwithdata
thatiscontiguous.Inotherwords,yourdatashouldcontainnoblankcolumns,no
blankrows,andthecolumnsmustallbelabeled.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage46CopyrightMay2010
2. FilterbyMultipleColumns‐Youcanfilterbymorethanonecolumn.
3. RemovingFiltersInExcel2003andearlier,afasterwaytoremovemultiplefiltersis
toturnofffilteringandthenturnfilteringbackon.InExcel2007youcansimpleclick
theClearbuttonintheSortandFilterGroupasshownbelow.
4. FiltersareAdditive‐Eachadditionalfilterisbasedonthecurrentfilterandfurther
reducesthesubsetofdata.
5. ThreeTypesofFiltersYoucanfilterbasedonlistvalues,byformats,orbycriteria.
Eachofthesefiltertypesismutuallyexclusiveforeachrangeofcellsorcolumntable.
Forexample,youcanfilterbycellcolororbyalistofnumbers,butnotbyboth;you
canfilterbyiconorbyacustomfilter,butnotbyboth.
6. FiltersEnabled‐Adropdownarrowmeansthatfilteringisenabledbutnot
applied.
7. FilterApplied‐AFilterbuttonmeansthatafilterisapplied.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage47CopyrightMay2010
8. FilterSpanning‐Thecommandsunder
theAllDatesinthePeriodmenu,such
asJanuaryorQuarter2,filterbythe
periodnomatterwhattheyear.This
canbeuseful,forexample,tocompare
salesbyaperiodacrossseveralyears.
9. ThisYearvs.YeartoDateFiltering‐
ThisYearandYeartoDateare
differentinthewaythatfuturedates
arehandled.ThisYearcanreturndates
inthefutureforthecurrentyear,
whereasYeartoDateonlyreturns
datesuptoandincludingthecurrent
date.
10. FilteringDates‐Alldatefiltersare
basedontheGregoriancalendaras
decreedbyPopeGregoryXIII,after
whomthecalendarwasnamed,on24
February1582.TheGregoriancalendarmodifiestheJuliancalendar'sregularfour
yearcycleofleapyearsasfollows:Everyyearthatisexactlydivisiblebyfourisaleap
year,exceptforyearsthatareexactlydivisibleby100;thecenturialyearsthatare
exactlydivisibleby400arestillleapyears.Forexample,theyear1900isnotaleap
year;theyear2000isaleapyear.
11. FilteringByDaysofWeek‐Ifyouwanttofilterbydaysoftheweek,simplyformat
thecellstoshowthedayoftheweek.
12. Top&BottomFiltering‐OntheDatatab,in
theSort&Filtergroup,clickFilter.Pointto
NumberFiltersandthenselectTop10.To
filterbynumber,clickItems.Tofilterby
percentage,clickPercent.Note‐Topand
bottomvaluesarebasedontheoriginal
rangeofcellsortablecolumnandnotthe
filteredsubsetofdata.
13. Above&BelowAverageFiltering‐Onthe
Datatab,intheSort&Filtergroup,click
Filter.PointtoFilterbyNumbersthatare
Above/BelowAverage.NoteThesevalues
arebasedontheoriginalrangeofcellsor
tablecolumnandnotthefilteredsubsetofdata.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage48CopyrightMay2010
14. FilteringOutBlanks‐Tofilterforblanks,intheAutoFiltermenuatthetopofthelist
ofvalues,clear(SelectAll),andthenatthebottomofthelistofvalues,select
(Blanks).
15. FilteringByColor‐SelectFilterbyColor,andthendependingonthetypeofformat,
selectFilterbyCellColor,FilterbyFontColor,orFilterbyCellIcon.
16. FilterbySelection‐Tofilterbytext,number,ordateortime,clickFilterbySelected
Cell'sValueandthen:Tofilterbycellcolor,clickFilterbySelectedCell'sColor.To
filterbyfontcolor,clickFilterbySelectedCell'sFontColor.Tofilterbyicon,click
FilterbySelectedCell'sIcon.
17. RefreshingFilters‐Toreapplyafilterafterthedatachanges,clickacellintherange
ortable,andthenontheDatatab,intheSort&Filtergroup,clickReapply.
DataFormExcel’s2003DataFormtoolmakesExcellookmoreandbehavemorelikea
database,suchasMicrosoftAccess.(TheFormbuttonhasnotbeenincludedontheOffice
FluentuserinterfaceRibbon,butyoucanstilluseitinOfficeExcel2007byaddingtheForm
buttontotheQuickAccessToolbar.)
Adataformprovidesaconvenientmeanstoenterordisplayonecompleterowof
informationinarangeortablewithoutscrollinghorizontally.Youmayfindthatusingadata
formcanmakedataentryeasierthanmovingfromcolumntocolumnwhenyouhavemore
columnsofdatathancanbeviewedonthescreen.Useadataformwhenasimpleformof
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage49CopyrightMay2010
textboxesthatlistthecolumnheadingsaslabelsissufficientandyoudon'tneed
sophisticatedorcustomformfeatures,suchasalistboxorspinbutton.
KeyPointsusingdataForm:
1. Youcannotprintadataform.

2. Becauseadataformisamodaldialogbox,youcannotuseeithertheExcelPrint
commandorPrintbuttonuntilyouclosethedataform.
3. YoumightconsiderusingtheWindowsPrintScreenkeytomakeanimageofthe
form,andthenpasteitintoMicrosoftWordforprinting.
DataSubtotalsExcelprovidesanautomaticsubtotalingwhichwillautomatically
calculateandinsertsubtotalsandgrandtotalsinyourlistortable.Onceinserted,Excel
recalculatessubtotalandgrandtotalvaluesautomaticallyasyouenterandeditthedetail
data.TheSubtotalcommandalsooutlinesthelistsothatyoucandisplayandhidethedetail
rowsforeachsubtotal.ExamplesofatheSubtotaldialogboxandaresultingsubtotaled
tableareshownbelow.
KeypointstoConsiderWhenUsingSubtotalingareasfollows:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage50CopyrightMay2010
1. ContiguousDataTheSubtotaltoolsworksbestwhenyouareworkingwithdata
thatiscontiguous.Inotherwords,yourdatashouldcontainnoblankcolumns,no
blankrows,andthecolumnsmustallbelabeled.
2. SortBeforeYourSubtotal‐Youmustsortthedatabythecolumnyouwishto
Subtotalby,elseyouwillreceiveerroneousresults.
3. OtherMathematicalApplications‐TheSubtotaltoolnotonlycalculatessubtotals,
butitcanalsocalculateminimums,maximums,averages,standarddeviations,and
otherfunctions.
4. Subtotalsin2007TablesExcel2007deploysSubtotalingalittledifferentlyinthat
theSubtotaltoolappearsatthebottomofeachcolumnineachtable,asshownin
thescreenbelow.

5. AutomaticOutlining‐SubtotalingautomaticallyinsertsOutlines,whichisreally
cool.Youcanthencondenseandexpandthedataintotalandbysubtotal.Some
CPAsalsoliketocopyandpastethecondensedsubtotalinformationtoanother
locationbutfindthatthisprocesscopiesandpastesallofthedata.Therearetwo
waystoachieveacleancopyandpastewithoutgrabbingallthehiddendataas
follows:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage51CopyrightMay2010
a. CTRLkeyHoldtheControlKeydownwhileyouindividuallyclickoneachsubtotal
row.Thiswillenableyoutocopyandpastejustthesubtotaldata.Thisapproachcan
beproblematicbecauseifyoumisclick,youhavetostartover.
b. SelectVisibleCellsAbetterapproachistousetheSelectVisibleCellstool.This
toolwillselectonthedatayoucansee,afterwhichthecopyandpasteroutinewill
yieldthedesiredresults.Thisoptionisbetterbecauseitisfasterandlesserror
prone.
DataValidation
DataValidationcanbeusedtolimitthedatathatcanbeenteredintoacell.Forexample,
youmightwanttheusertoenteronlyvaluesbetween1%and99%.Youmightalsousethis
tooltoenabledatainputtoadropdownlist.Thishastwoadvantagesinthatitcanbe
fasterandmoreaccurate.Startwiththedialogboxbelowtocreateyourdropdownlist
functionality.
Aftermakingallthenecessaryselectionsinthevalidationlistdialogbox,yourworksheet
willbehaveasshownbelow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage52CopyrightMay2010
Youcanalsoprovidemessagestodefinewhatinputyouexpectforthecell,andinstructions
tohelpuserscorrectanyerrors.Forexample,inamarketingworkbook,youcansetupacell
toallowonlyaccountnumbersthatareexactlythreecharacterslong.Whenusersselectthe
cell,youcanshowthemamessagesuchasthisone:
Ifusersignorethismessageandtypeinvaliddatainthecell,suchasatwodigitorfivedigit
number,youcanshowthemanactualerrormessage.Inamoreadvancedscenario,you
mightusedatavalidationtocalculatethemaximumallowedvalueinacellbasedonavalue
elsewhereintheworkbook.Inthefollowingexample,theuserhastyped$4,000incellE7,
whichexceedsthemaximumlimitspecifiedforcommissionsandbonuses.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage53CopyrightMay2010
Ifthepayrollbudgetweretoincreaseordecrease,theallowedmaximuminE7would
automaticallyincreaseordecreasewithit.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage54CopyrightMay2010
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,PivotTablespresentmultidimensionaldataviewstotheuserthisprocessis
oftenreferredtoas“modeling”,“datacubeanalysis”,or“OLAPdatacubes”.Torearrange
thePivotTabledata,justdraganddropcolumnandrowheadingstomovedataaround.
PivotTablesareagreatdataanalysistoolformanagement.
IfyouhaveneverusedaPivotTablebefore,initiallytheconceptcanbedifficulttograsp.
ThebestwaytounderstandaPivotTableistocreateablankPivotTableandthendragand
dropfieldnamesontothatblanktable.Thiswayyouwillseetheresultingpivottable
magicallyappearanditwillhelpyoubetterunderstandtheimportantrelationshipbetween
thepivotpalletandthefieldnamelist.
Let’screateasimplePivotTable.StartwithanExcelworksheetdatathatcontainsseveral
columnsofdatathedatamustincludecolumnandrowheadingsandithelpsifthedatais
contiguous.PlaceyourcursoranywhereinthedataandselectPivotTablefromtheData
menuinExcel2003andclickFinish;orfromtheinsertRibboninExcel2007.Thisprocessis
shownbelow:Let’sstartwithapageofdatasummarizingtheresultsoftaxseasonasallof
thetimesheetentrieshavebeenenteredontoasingleworksheetasshownbelow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage55CopyrightMay2010
PlaceyourcursoranywhereinthedataandselectPivotTablefromtheInsertRibbonas
shownbelow:
Forlearningpurposeslet’srightmouseclickonthepivottableandselectPivotTableOptions,
Display,ClassicPivotTableLayout.Yourscreenwillnowappearasfollows:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage56CopyrightMay2010
IlikeforCPAstolearnhowtousePivotTablesinthisviewbecauseitvisuallyhelpsthem
understandtheallimportantrelationshipbettertheblankpivotpaletteandthePivotTable
fieldList,bothelementsofwhichareshowninthescreenabove.
Toproceed,simplydraganddropfieldnamesshownontherightontotheblankPivot
paletteshownontheleft.Witheachdrop,yourreportgrowslarger.Asanalternativeyou
couldusethecheckboxesnexttofieldnamesthisfunctionalityisnewinExcel2007.After
addedsomedatatoyourblankPivotPalette,yourdatawilllooksomethinglikethis:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage57CopyrightMay2010
NextformatandfilterthePivotReport.Veryquicklyyourreportcomestogetherasshown
below.NoticethefilterbuttonhasbeenappliedandaPivottablestylehasalsobeenapplied
forappearance.
Doubleclickingonanynumberinapivotreportwillautomaticallyproduceanewworksheet
completewithallsupportingdetailthatcomprisesthesummarynumber.
ThereareamultitudeofPivotTableoptionsthatcanbeappliedtoaltertheappearanceor
behaviorofyourPivottable.
KeyPointsConcerningPivotTablesareasFollows:
a. YoucancreateasmanyPivotReportsasyouwantfromyourinitialrawdatapage.Yourraw
dataremainsunchangedasnewPivottablesarecreated.
b. Asyourrawdatachanges,yourpivottablesareupdatedeachtimeyoupresstherefresh
button.OrifyoupreferyoucansetyourPivotTablestoupdatethemselvesatregularly
scheduledintervalssayeverytenminutes.
c. AkeytounderstandingPivotTablesisunderstandingtherelationshipbetweentheBlank
PivotpaletteandthePivotTableFieldlist.Asdataisselectedinthelist,itappearsonthe
PivottableReport.
d. YoucanalterthePivotTablesimplebydragginganddroppingthefieldnamesindifferent
locationsonthePivotpalette,orindifferentlocationsinthePivotTableFieldlistBox.
e. PivotTablescanbepivoted.
f. PivotTablescanbesortedbyanyColumn.(Orbyanyrowwhensortinglefttoright)
g. PivotTablescanbeFiltered.
h. PivotTablescanbeDrilled.
i. PivotTablescanbecopiedandpasted.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage58CopyrightMay2010
j. PivotTablescanbeformattedusingPivotTableStyles,asshownbelow.
k. Subtotalsandgrandtotalscanbedisplayedorsuppressedattheusersdesire.
l. PivotTableDatacanbeshownasnumbersorpercentagesattheusersdesire.
m. PivotTablecannotonlybesummed,itcanbeaveraged,minimized,maximized,counted,etc.
n. Blankrowscanbedisplayedorsuppressedattheusersdesire.
o. Anewfeaturecalled“CompactForm”organizedmultiplecolumnlabelsintoaneatly
organizedoutlinewhichiseasiertoread.
p. PivotTablescanquerydatadirectlyfromanyODBCcompliantdatabase.ThePivotTabletool
foraccomplishingthistaskisnotincludedintheribbonyouwillfinditbyCustomizingthe
QuickAccessToolBarandsearchingthe“CommandsNotShownintheRibbon”tabtofind
thePivotTableandPivotChartWizardOption.
q. ManyaccountingsystemscanpushdataoutoftheaccountingsystemintoanExcel
PivotTableformatthisiscommonlyreferredtoasanOLAPDataCube.OLAPdataCubeis
justafancywordforPivotTableandthereisnodifference.
r. PivotTablescanautomaticallycombinedatafrommultipledatasources.ThePivotTabletool
foraccomplishingthistaskisnotincludedintheribbonyouwillfinditbyCustomizingthe
QuickAccessToolBarandsearchingtheCommandsNotShownintheRibbontabtofind
thePivotTableandPivotChartWizardOption.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage59CopyrightMay2010
s. ExcelalsoprovidesaPivotChartfunctionwhichworkssimilarlytoPivotTables.Presented
belowisanexamplePivotChart.
Excel2003PivotTablesworkverysimilarlyasshownbelow.ExcelcreatesablankPivotTable,
andtheusermustdraganddropthevariousfieldsfromthePivotTableFieldListontothe
appropriatecolumn,row,ordatasection.Asyoudraganddroptheseitems,theresulting
reportisdisplayedonthefly.HereistheblankPivotPaletteview.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage60CopyrightMay2010
NowdraganddropfieldnamesfromthePivotTablefieldlistontothePivotpallet.This
actionwillautomaticallycreatePivotTablereportsandtheywillchangeeachtimeyou
dropadditionalfieldnames,ormovefieldnamesaround.Presentedbelowarebutafew
examplesofhundredsofpossiblereportsthatcouldbeviewedwiththisdatathroughthe
PivotTableformat.
Thisreportshownaboveshowsthetotalresultingsalesforeachmarketingcampaignfor
eachofthe4monthsmarketingcampaignswereconducted.
Inthisscreenweseethesameinformationisshownasapercentageofthetotal.Afew
observationsincludethefactthatoverallRadioSpotsarethemostprofitabletypeof
campaign,butonlyinAprilandJuly.InJanuaryandOctober,localadsanddirectmail,
respectively,producebetterresults.Further,Aprilcampaignshadthebestresponseoverall.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage61CopyrightMay2010
Furtheranalysisinthescreenabovetellsusthatourresultsvarywidelyfromonecitytothe
next.InNewYork,couponswereleasteffective,butcouponsweremosteffectivein
Columbus.PivotchartsbasedonPivotTabledatacanbemodifiedbypivotingand/or
narrowingthedata.TheycanalsobepublishedontheInternet(oronanIntranet)as
interactiveWebpages.Thisallowsusersto“play”withthedata.Thechartbelowprovidesa
visuallookatthedatashownabove.
FilteringPivotTables‐Ifyoutakeacloselookatyourresultingpivottables,youwillnotice
thatExcelautomaticallyinsertsafilterbuttononeachfieldlistasshownbythedropdown
arrowsinthescreenbelow:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage62CopyrightMay2010
Thisdropdownfilterlistmakesiteasytorefineyourreporttoincludejustthedatayou
want.
DrillingPivotTables‐Anothernicefeatureinpivottablesisthattheyareautomatically
drillable.SimplydoubleclickonanynumberinapivotreporttophaveExcelautomatically
insertanewsheetandproducethedetailedreportunderlyingthenumberyouclickedon.
Anexampleofthisisshownbelow:
PivotTableOptions‐Byrightmouseclickingonyourpivottableyouwillrevealseveral
optionsettingsboxesasshownbelow.Forexample,theseoptionsboxescontrolthetypesof
subtotalsproducedinyourpivotreports.Excelalsooffersapivottableoptionsboxaswellas
alayoutwizardthatmakesproducingpivottablesalittleeasier.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage63CopyrightMay2010
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage64CopyrightMay2010
DataTable(“WhatifAnalysis”)
Datatablesarepartofasuiteofcommandsthatarecalledwhatifanalysistools.Whenyou
usedatatables,youaredoing“whatifanalysis”.Whatifanalysisistheprocessofchanging
thevaluesincellstoseehowthosechangeswillaffecttheoutcomeofformulasonthe
worksheet.Forexample,youcanuseadatatabletovarytheinterestrateandtermlength
thatareusedinaloantodeterminepossiblemonthlypaymentamounts.
ThreecategoriesofWhatifAnalysisTools‐Therearethreekindsofwhatifanalysistoolsin
Excel:
1. DataTables
2. GoalSeek
3. Scenarios
Adatatablecannotaccommodatemorethantwovariables.Ifyouwanttoanalyzemore
thantwovariables,youshouldinsteadusescenarios.Althoughitislimitedtoonlyoneor
twovariables(onefortherowinputcellandoneforthecolumninputcell),adatatablecan
includeasmanydifferentvariablevaluesasyouwant.Ascenariocanhaveamaximumof32
differentvalues,butyoucancreateasmanyscenariosasyouwant.
LoanAnalysis‐Inthisexercise,westartbycreatingasimplePaymentfunctiontocalculate
thepaymentamountofaloangivenaloanamount,interestrateandnumberofperiods.
Thenextstepistocreatea“TwoWayDataTable”displayingtheresultingpaymentamount
givenavarietyoflengthsoftheloan.Thisprocessisstartedbycreatingalistofthe
alternativeloanamounts,asshownbelowinB8,B9,B10,etc.CellC7mustreferencethe
resultsyouwanttobedisplayedinthetable.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage65CopyrightMay2010
ThenextstepistohighlightthedatatablerangeandusetheDataTablecommandunder
theDatamenu(asshownbelow)togeneratethedesiredtable.
Thisprocesswillgeneratethefollowingtable:
Thistabletellsusthatthesameloanamountwillrequireamonthlypaymentof$3,331to
paytheloanoffinjust10years,andamonthlypaymentof$5,800torepaytheloaninjust
5years.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage66CopyrightMay2010
Thenextstepinthisexerciseistogeneratealinechartbasedonthedatatablewejust
created.Thislinechartwillprovidesomeinterestingobservationsregardingthebenefits
anddetrimentsofpayingoffloansoverlongerperiods.
Theresultingchartisshownasfollows:
Basedonthis,nooneshouldeverobtainafairmarketloanformorethan15years,the
reductioninpaymentssimplyaren’tworththeadditionallengthoftheloan.Thissamebasic
behaviorisseenwhethertheinterestrateis1%or100%.Theonlytimeyoumightbe
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage67CopyrightMay2010
justifiedinobtainingaloanlonerthan15yearsmightbewhenyouareextendeda
favorableinterestthisbetterthanafairmarketinterestrate.
Goal Seek
Ifyouknowtheresultthatyouwantfromaformula,butarenotsurewhatinputvaluethe
formulaneedstogetthatresult,usetheGoalSeekfeature.Forexample,supposethatyou
needtoborrowsomemoney.Youknowhowmuchmoneyyouwant,howlongyouwantto
taketopayofftheloan,andhowmuchyoucanaffordtopayeachmonth.YoucanuseGoal
Seektodeterminewhatinterestrateyouwillneedtosecureinordertomeetyourloan
goal.GoalSeekworksonlywithonevariableinputvalue.Ifyouwanttoacceptmorethan
oneinputvalue;forexample,boththeloanamountandthemonthlypaymentamountfora
loan,youusetheSolveraddindiscussedattheendofthismanual.
Scenarios
ScenarioManagerallowsyoutocreateandsavemultiple“whatif”scenarios(suchasbest
case,mostlikely,andworstcasesscenarios).Youcanalsocreateasummarytableofthe
scenarioresultsinseconds.Itisparticularlyusefulforworksheetssuchasbudgetsinwhich
usershaveoftensavedmultiplecopiesofthesameworksheettoaccomplishthesame
objective.Anexampleisshownbelow.Inthisexample,atirecompanyhasprepareda
revenuebudgetforthecomingyear,andhascreatedthreealternativescenariosto
generatetherevenuesthatwillresultgivenavarietyofmarkupassumptionsinthiscase
100%,110%and120%markups.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage68CopyrightMay2010
Pressingthesummarybuttoninthescenariomanagerdialogboxwillcreatethefollowing
PivotTableofpossiblealternativeresults.Hereweseedetailedrevenueprojectionsforall
tiresandlaborfeesgivenallthreepossiblescenariosof100%,110%,and120%markup.
Withafewsimplecopypastecommands,thenewlycreateddatacanbepositionedand
formattednexttotheoriginalprojectionsasshowninthescreenbelow.
Ofcoursethescenariosabovecouldhavebeencreatedeasilyusingsimpleformulasinstead
ofusingthescenariomanagertoolasdescribedabove.Thisunderscoresthatbestpurpose
ofscenariomanagerwhichistokeeptrackofolderandchangingdatathroughtime,rather
thanproducingwhatifscenarios.Forexample,acomplexprojectioncontainingscenarios
basedonoriginalassumptions,revisedassumptions,andfinalassumptionswillallow
managementtogobackandreviewtheassumptionsusedthroughouttheproject,andsee
howthoseassumptionschangedasprojectplanningprogressed.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage69CopyrightMay2010
Data‐TexttoColumns
Asdiscussedearlierinthismanual,oftenCPAsreceivedatafromtheirclientsorIT
departmentsthatisintextform.Whenthishappens,Excelcansplitthecontentsofoneor
morecellsinacolumnanddistributethosecontentsasindividualpartsacrossothercellsin
adjacentcolumns.Forexample,theworksheetbelowcontainsacolumnoffullnamesand
amountsthatyouwanttosplitintoseparatecolumns.TheTexttoColumnsWizardparses
thedataautomaticallyintoseparate
Selectthecell,range(range:Twoormorecellsonasheet.Thecellsinarangecanbe
adjacentornonadjacent.),orentirecolumnthatcontainsthetextvaluesthatyouwantto
split.NoteArangethatyouwanttosplitcanincludeanynumberofrows,butitcaninclude
nomorethanonecolumn.Youalsoshouldkeepenoughblankcolumnstotherightofthe
selectedcolumntopreventexistingdatainadjacent
DataConsolidate
Excelcancombine,summarize,andreportconsolidatedresultsfromseparateworksheets.
Theunderlyingworksheetscanbeinthesameworkbookorinotherseparateworkbooks.
Therearetwodifferentsitautionsasfollows:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage70CopyrightMay2010
1. YouAreConsolidatingSimilarDataSuchasdepartmentalbudgetswhereeveryworksheet
containstheexactsamelabelsintheexactsamecells.Inthiscase,youcanwritea“Spearing
Formula”whichcanconsolidatethenecessaryinformationeasily.
2. YouAreConsolidatingDisSimilarDataThevariousworksheetscontaindifferentrowand
columndescriptionslocatedindifferentlocationsontheworksheets.Inthiscaseyoushould
usetheDataConsolidatecommand.
Forexample,assumethatyouhavereceivedbudgetsfrommultipledepartments,andyou
wanttocombinethemtogether.Inthiscase,Excelwilldotheworkforyou.Youcanusea
consolidationtorollupthesefiguresintoacorporatebudgetworksheet,asshownbelow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage71CopyrightMay2010
DataGrouping&Outlining
Ifyouhavealistofdatathatyouwanttogroupandsummarize,youcancreateanoutline
ofuptoeightlevels,oneforeachgroup.Eachinnerlevel,representedbyahighernumber
intheoutlinesymbolsdisplaysdetaildatafortheprecedingouterlevel,representedbya
lowernumberintheoutlinesymbols.Useanoutlinetoquicklydisplaysummaryrowsor
columns,ortorevealthedetaildataforeachgroup.Youcancreateanoutlineofrows(as
shownintheexamplebelow),anoutlineofcolumns,oranoutlineofbothrowsand
columns.
WebQueries
Excelincludespredesigned“queries”thatcanimportcommonlyuseddatain10seconds.
Forexample,youcoulduseawebquerytocreateastockportfolio.Allyouneedisa
connectiontotheInternetandofcourse,somestocktickersymbols.InExcel2003select
“Data,ImportExternalData,ImportData”andwalkthroughthewebquerywizardfor
importingstockquotes.InExcel2007andlaterusetheDataRibbon,ExistingConnections,
StockQuotesoption.Inseconds,Excelwillretrieve20minutedelayedstockpricesfromthe
web(duringthehourswhenthestockmarketisopen)anddisplayagridofcompleteupto
datestickpriceinformationthatissynchronizedtothestockmarket’schangingstockprices.
Witheachclickofthe“Refresh”button,thestockpriceinformationinExcelisupdated‐
thissurebeatspickingnumbersoutofthenewspaper.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage72CopyrightMay2010
CompletingtheStockPortfolioNextlinkthegriddatatoanotherworksheet,andinsert
newcolumnscontainingthenumberofsharesowned,aswellsasanadditionalcolumnto
computerthetotalvaluebasedonsharesowned,asshownbelow.
RefreshingtheStockPrices‐Onceyouhavecreatedyourportfolio,simplyclicktheRefresh
Databuttononthe“ExternalData”ToolbarinExcel2003oronthe“DataRibbon”inExcel
2007shownbelowtoupdatethecurrentvalueofyourPortfolio.
 
QueryParameters‐Therearenumerousoptionstohelpyouextractexactlythedatayou
wanttheywayyouwantit.The“WebQueryParametersBox”,“WebQueryOptionsbox”
and“ExternalDataPropertiesBox”providenumerousoptionsforcontrollingyourweb
query.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage73CopyrightMay2010
DatabaseQueries
MicrosoftExcelcanalsoqueryandretrievedatayouwantfromanexternaldatasource.For
example,youcanretrieveMicrosoftExceldataaboutaspecificproductbyregion.Youcan
createasimplequerybyusingtheQueryWizard,oryoucancreateamorecomplexquery
byusingtheadvancedfeaturesofMicrosoftQuery.
TouseMicrosoftQuerytoretrieveexternaldata,youmust:
1. Haveaccesstoanexternaldatasource‐Ifthedataisnotonyourlocalcomputer,
youmayneedtoseetheadministratoroftheexternaldatabaseforapassword,user
permission,orotherinformationabouthowtoconnecttothedatabase.
2. InstallMicrosoftQuery‐IfMicrosoftQueryisnotavailable,youmightneedto
installit.
3. Specifyasourcetoretrievedatafrom,andthenstartusingMicrosoftQuery‐For
example,ifyouwanttoinsertdatabaseinformation,displaytheDatabasetoolbar,
clickInsertDatabase,clickGetData,andthenclickMSQuery.
Forexample,supposewehavesomedatainouraccountingsystemSageMAS200ERP
thatwewouldliketoanalyzeinExcel.WecanusetheDatabaseQueryWizardtobuilda
querythatwillextractthedataweneedandplaceitinanExcelspreadsheet.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage74CopyrightMay2010
Thefirststepistoselectthetypeofdatabaseyouwanttoqueryandtoselectthespecific
database.
Upontheselectionofthedesireddatabasealistoftableswillbepresented.Choosethe
desiredtables,andselectthedesireddatafieldstobeimported.Youwillthenhavethe
optiontofilterandsortthedatabeforeitisimported.Finallyyouwillbegiventheoption
tosavethequerysothatyoucanrunitatalaterdatewithouthavingtostartfromscratch.
Excelwillthenreturnatablefullofthedatayourequestedasshowninthescreenbelow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage75CopyrightMay2010

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage76CopyrightMay2010
Chapter5
MACROS
AutomatingYourKeyStrokes

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage77CopyrightMay2010
Macros

MacrosofferapowerfulandflexiblewaytoextendthefeaturesofExcel.Theyallowthe
automationofrepetitivetaskssuchasprinting,formatting,configuring,orotherwise
manipulatingdatainExcel.Inits’simplestform,amacroisarecordingofyourkeystrokes.
WhilemacrosrepresentoneofthestrongerfeaturesfoundinExcel,theyarerathereasyto
createanduse.TherearesixmajorpointsthatIliketomakeaboutmacrosasfollows.

1. Record,UseExcel,StopRecordingTocreateamacro,simplyturnonthemacro
recorder,useExcelasyounormallydo,thenturnofftherecorder.Prestoyouhave
createdamacro.Whiletheprocessissimplefromtheuser’spointofview,
underneaththecoversExcelcreatesaVisualBasicsubroutineusingsophisticated
VisualBasicprogrammingcommands.
2. MacroLocationMacroscanbestoredineitheroftwolocations,asfollows:
a. Theworkbookyouareusing,or
b. YourPersonalMacroWorkbook(whichbydefaultishiddenfromview)
Ifyourmacroappliestoallworkbooks,thenstoreitinthePersonalMacro
WorkbooksoitwillalwaysbeavailableinallofyourExcelworkbooks;otherwise
storeitinyourcurrentworkbook.Amacrostoredinyourcurrentworkbookwillbe
embeddedandincludedintheworkbook,evenifyouemailtheworkbookto
anotheruser.

3. AssignyourMacrotoanIcon,TextoraButtonTomakeiteasytorunyourmacro,
youshouldassignittoatoolbariconsoitwillalwaysbeavailablenomatterwhich
workbooksyouhaveopen.Ifthemacroappliesonlytoyourcurrentworkbook,then
assignittoTextoramacroButtonsoitwillbequicklyavailableinyourcurrent
workbook.
4. AbsoluteversusRelativeMacrosAn“Absolute”macrowillalwaysaffectthesame
cellseachtimewhereasa“Relative”macrowillaffectthosecellsrelativetowhere
yourcursorispositionedwhenyouinvokethemacro.Itiscrucialthatyou
understandthedifference.
5. EditingMacrosOncecreated,youcanviewand/oredityourmacrousingtheView
Macrosoption.ThiswillopenthemacrosubroutineinaVisualbasicprogramming
windowandprovideyouwithaplethoraofVBtools.
6. AdvancedVisualBasicProgrammingForthetrulyambitiousCPA,intheVisual
BasicProgrammingwindow,youhavethenecessarytoolsyouneedtobuildvery
sophisticatedmacroswithdialogboxes,dropdownmenuoptions,checkboxes,
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage78CopyrightMay2010
radiobuttonsthewholeworks.Iinviteyoutoknockyourselfout.Toseeallofthis
power,turnonthe“DeveloperTab”in“ExcelOptions”(seebelow).

Presentedbelowaremoredetailedcommentsandstepbystepinstructionsforcreating
andinvokingmacros,followedbysomeexamplemacros.

1. CreatingaMacro‐Tocreateamacro,click“RecordMacro”inthe“CodeGroup”onthe
DeveloperTab.

a. AssignaName‐Inthe“MacroName”box,enteranameforthemacro.

i. Thefirstcharacterofthemacronamemustbealetter.
ii. Subsequentcharacterscanbeletters,numbers,orunderscore
characters.
iii. Spacescannotbeusedinamacroname(anunderscorecharacter
isoftenusedasawordseparator.
iv. Ifyouuseamacronamethatisalsoacellreference,youmayget
anerrormessagethatthemacronameisnotvalid.

b. AssignaCTRLCombination(optional)YoucanassignaCTRLcombination
shortcutkeytorunthemacrobytypinganylowercaseletteroruppercase
letterthatyouwanttouseintheShortcutkeybox.

i. TheshortcutkeywilloverrideanyequivalentdefaultExcel
shortcutkeywhiletheworkbookthatcontainsthemacroisopen.

c. MacroLocation‐IntheStoreMacroIn”list,selecttheworkbookwhere
youwanttostorethemacro.

i. Asmentionedabove,ifyouwantamacrotobeavailable
wheneveryouuseExcel,selectPersonalMacroWorkbook”.
WhenyouselectPersonalMacroWorkbook,Excelcreatesa
hiddenpersonalmacroworkbook(Personal.xlsb)ifitdoesnot
alreadyexist,andsavesthemacrointhisworkbook.
ii. InWindowsVista,thisworkbookissavedintheC:\Users\user
name\AppData\Local\Microsoft\Excel\XLStartfolder.
iii. InMicrosoftWindowsXP,thisworkbookissavedinthe
C:\DocumentsandSettings\username\Application
Data\Microsoft\Excel\XLStartfolder.
iv. WorkbooksintheXLStartfolderareopenedautomatically
wheneverExcelstarts.
v. Ifyouwantamacrointhepersonalmacroworkbooktoberun
automaticallyinanotherworkbook,youmustalsosavethat
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage79CopyrightMay2010
workbookintheXLStartfoldersothatbothworkbooksare
openedwhenExcelstarts.

d. MacroDescription‐IntheDescriptionbox,typeadescriptionofthe
macro.

e. StartRecording‐ClickOKtostartrecording.

f. StartTyping‐Performtheactionsthatyouwanttorecord.
g. StopRecordingWhenyouaredoneclick“StopRecording”inthe“Code
Group”Onthe“DeveloperTab”.
i. YoucanalsoclickStopRecordingontheleftsideofthestatus
bar.
h. Assignamacrotoanobject,graphic,orcontrol‐Onaworksheet,right
clicktheobject,graphic,orcontroltowhichyouwanttoassignan
existingmacro,andthenclickAssignMacro.IntheMacronamebox,click
themacrothatyouwanttoassign.
2. MenuNavigationNotRecorded‐Whenyourecordamacro,themacrorecorder
recordsallthestepsrequiredtocompletetheactionsthatyouwantyourmacroto
perform.NavigationontheRibbonisnotincludedintherecordedsteps,onlythe
commandsthatareexecutedarerecordedinthemacro.
3. TurnOnTheDeveloperTab‐TurnontheDevelopertabbyclickingtheMicrosoft
OfficeStartButton,andthenclickExcelOptions.InthePopularcategory,underTop
optionsforworkingwithExcel,selecttheShowDevelopertabintheRibboncheck
box,andthenclickOK.
4. EnableMacrosIfthemacrofunctionsaredisabled,youcanenablethemby
selectingMacroSecurityintheCodegroupontheDevelopertabasshownbelow.


UnderMacroSettings,clickEnableallmacros(notrecommended,potentially
dangerouscodecanrun),andthenclickOK.

5. ExampleMacros
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage80CopyrightMay2010
a. PageSetupMacroStartrecordinganewmacrocalledpagesetup.Select
alloftheworksheetsandthenchoosePageSetupandcustomizetheheader
andfooterstoincludepagenumbers,dateandtimestamps,filelocations,
tabnames,etc.AssignthemacrotoanIcononyourtoolbarorQuickAccess
Barandinsettingheadersandfooterswillbeabreezefortherestofyour
life.
b. PrintMacrosDoyouhaveatemplatethatyouprintfrequentlyfrom?Ifso,
insertseveralmacrobuttonstoprinteachreport,agroupofreports,and
evenmultiplereportsandreportingwillbesnapinthefuture.
c. DeleteDataMacroDoyouhaveatemplatethatyouuseoftenthat
containsalotofvariables?Ifso,createamacrothatvisitseachcelland
erasesthatdata,resettingtheworksheetforuseinanewsetofcriteria.
Assignthemacrotoamacrobuttonandyouwillneveragainhaveold
assumptionsmixedinwithyournewertemplate.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage81CopyrightMay2010
Chapter6
Miscellaneous

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage82CopyrightMay2010
Solver
SolverisoneofthemorepowerfulfeaturesinExcelbecauseitcansolveforoptimum
resultsincomplexworksheetswhileobeyingstatedconstraints.WithSolver,youcanfind
anoptimalvalueforaformulabymanipulatingagroupofcellsthatarerelated,either
directlyorindirectly,totheformulainthetargetcell.Solveradjuststhevaluesinthe
adjustablecellstoproducetheresultyouspecifyfromthetargetcellformula.Youcanapply
constraintstorestrictthevaluesSolvercanuseinthemodel,andtheconstraintscanrefer
toothercellsthataffectthetargetcellformula.
Intheportfolioexampleshownbelow,theuserwishestodeterminehowmuchmoneyto
investinvariousinvestmentsinordertomaximizethereturnonthoseinvestments.Of
coursethemaximumresultscanbeachievedbysimplyplaceinallmoniesintheinvestment
thatyieldsthehighestresults,howeverthisapproachviolatesthe“don’tputallofyoureggs
inonebasketrule”.Inthiscasetheuserwantstodiversifytheirfundsacrossmanytypesof
investments.Thereforeconstraintsareestablishedsuchasnomorethan35%offundscan
beinvestedinbluechipstocksandthecheckingaccountingmustcontainatleast$100,000.
Aportfolioisshownbelowandsomeconstraintshavebeenincludedinlustform.These
constraintswillneedtobestatedintermsofformulasinthesolvermanagerdialogbox.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage83CopyrightMay2010
ThekeytomakingsolverworkisthesolverParametersdialogboxshownbelow.

Thetargetcellissettorefertothetotalportfoliovalueattheendoftheyearbecausethis
isthevaluethatwewanttomaximize.Thechangingcellsaresettoreferencethe
percentagesofeachinvestment.Finallythevariousconstraintsareexpressedasformulasas
showninthelowerlefthandcornerofthedialogbox.Oncesolverhasbeenrunonce,the
solverformulassticktotheworksheetandtheresultsarechangedandupdatedasthe
variousassumptionsintheworksheetarechangedandupdated.Forexample,youmay
laterdeterminethatthegrowthrateforrealestateisadifferentamount.Inputtingthat
newamountintheworksheetwillcauseExceltoautomaticallyadjustallvariablesto
producetheoptimuminvestmentmixthatmaximizesearningswithoutviolatinganystated
constraints.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage84CopyrightMay2010
Chapter7
XMLData

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage85CopyrightMay2010
OverviewofXMLinExcel
HideAll
MicrosoftOfficeExcelmakesiteasytoimportExtensibleMarkupLanguage(XML)(Extensible
MarkupLanguage(XML):AcondensedformofStandardGeneralizedMarkupLanguage(SGML)that
enablesdeveloperstocreatecustomizedtagsthatofferflexibilityinorganizingandpresenting
information.)datathatiscreatedfromotherdatabasesandapplications,tomapXMLelements
fromanXMLschema(XMLSchema:Aformalspecification,writteninXML,thatdefinesthe
structureofanXMLdocument,includingelementnamesandrichdatatypes,whichelementscan
appearincombination,andwhichattributesareavailableforeachelement.)toworksheetcells,and
toexportrevisedXMLdataforinteractionwithotherdatabasesandapplications.Thinkofthese
XMLfeaturesasturningOfficeExcelintoanXMLdatafilegeneratorwithafamiliaruserinterface.
1.
WhyuseXMLinExcel?
a. XMLdataandschemafiles
b. KeyXMLandExcelscenarios
2.
ThebasicprocessofusingXMLdatainExcel
a. WorkingwithXMLmaps
b. UsingtheXMLSourcetaskpane
c. Elementtypesandtheiricons
d. Workingwithsinglemappedcells
e. WorkingwithrepeatingcellsinXMLtables
f. XMLmapsecurityconsiderations
g. ImportingXMLdata
h. Workingwithaninferredschema
i. ExportingXMLdata
3.
UsingtheExcelmacroenabledOfficeXMLFormatfile
WhyuseXMLinExcel?
XMLisatechnologythatisdesignedformanagingandsharingstructureddatainahumanreadable
textfile.XMLfollowsindustrystandardguidelinesandcanbeprocessedbyavarietyofdatabases
andapplications.UsingXML,applicationdesignerscancreatetheirowncustomizedtags,data
structures,andschemas.Inshort,XMLgreatlyeasesthedefinition,transmission,validation,and
interpretationofdatabetweendatabases,applications,andorganizations.
XMLdataandschemafiles
ExcelworksprimarilywithtwotypesofXMLfiles:
XMLdatafiles(.xml),whichcontainthecustomtagsandstructureddata.
Schemafiles(.xsd),whichcontainschematagsthatenforcerules,suchasdatatypeandvalidation.
NoteTheXMLstandardalsodefinesExtensibleStylesheetLanguageTransformation(XSLT)(XSL
Transformation(XSLT):AfilethatisusedtotransformXMLdocumentsintoothertypesof
documents,suchasHTMLorXML.ItisdesignedforuseaspartofXSL.)(.xslt)files,whichareusedto
applystylesandtransformXMLdataintodifferentpresentationformats.Youcanapplythese
transformsbeforeyouimportXMLfilesintoExcelandafteryouexportXMLfilesfromExcel.IfXSLT
filesarelinkedtoXMLdatafilesthatyouimportintoExcel,youdohavetheoptiontoapplyornot
applytheformattingbeforethedataisaddedtotheworksheet,butonlywhenyouopenanXMLfile
byusingtheOpencommandontheMicrosoftOfficeButton.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage86CopyrightMay2010
KeyXMLandExcelscenarios
ByusingXMLandExcel,youcanmanageworkbooksanddatainwaysthatwerepreviously
impossibleorverydifficult.ByusingXMLmaps,youcaneasilyadd,identify,andextractspecific
piecesofbusinessdatafromExceldocuments.Forexample,aninvoicethatcontainsthenameand
addressofacustomerorareportthatcontainslastquarter'sfinancialresultsarenolongerjust
staticreports.Youcaneasilyimportthisinformationfromdatabasesandapplications,reviseit,and
exportittothesameorotherdatabasesandapplications.Thefollowingarekeyscenariosthatthe
XMLfeaturesaredesignedtoaddress:
1.
ExtendthefunctionalityofexistingExceltemplatesbymappingXMLelementsontoexisting
cells.ThismakesiteasiertogetXMLdataintoandoutofyourtemplateswithouthavingto
redesignthem.
2.
UseXMLdataasinputtoyourexistingcalculationmodelsbymappingXMLelementsonto
existingworksheets.
3.
ImportXMLdatafilesintoanewworkbook.
4.
ImportXMLdatafromaWebserviceintoyourExcelworksheet.
5.
ExportdatainmappedcellstoXMLdatafilesindependentfromotherdataintheworkbook.
ThebasicprocessofusingXMLdatainExcel
Thefollowingdiagramshowshowthedifferentfilesandoperationsworktogetherwhenyouuse
XMLwithExcel.Essentially,therearefivephasestotheprocess:
1.
AddinganXMLschemafile(.xsd)toaworkbook
2.
MappingXMLschemaelementstoindividualcellsorXMLtables
3.
ImportinganXMLdatafile(.xml)andbindingtheXMLelementstomappedcells
4.
Enteringdata,movingmappedcells,andleveragingExcelfunctionality,whilepreserving
XMLstructureanddefinitions
5.
ExportingreviseddatafrommappedcellstoanXMLdatafile
6.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage87CopyrightMay2010
WorkingwithXMLmaps
YoucancreateoropenaworkbookinExcel,attachanXMLschemafile(.xsd)totheworkbook,and
thenusetheXMLSourcetaskpanetomapXMLelementsoftheschematoindividualcellsortables.
AfteryoumaptheXMLelementstoyourworksheet,youcanimportandexportXMLdataintoand
outofthemappedcells.WhenyouaddanXMLschemafile(.xsd)toyourworkbook,youcreatean
XMLmap.Ingeneral,XMLmapsareusedtocreatemappedcellsandtomanagetherelationship
betweenmappedcellsandindividualelementsintheXMLschema.Inaddition,theseXMLmapsare
usedtobindthecontentsofmappedcellstoelementsintheschemawhenyouimportorexport
XMLdatafiles(.xml).
Therearetwokindsofmappedcellsthatyoucancreate:singlemappedcellsandrepeatingcells
(whichappearasXMLtables).Tomakedesigningyourworksheetmoreflexible,youcandragthe
mappedcellsanywhereonaworksheetandintoanyorderevenonedifferentfromtheXML
schema.Youcanalsochoosewhichelementstomapandnotmap.
ThefollowingrulesaboutusingXMLmapsareimportanttoknow:
1. AworkbookcancontainoneormoreXMLmaps.
2. Youcanonlymaponeelementtoonelocationinaworkbookatatime.
3. EachXMLmapisanindependententity,evenifmultipleXMLmapsinthesameworkbook
refertothesameschema.
4. AnXMLmapcanonlycontainonerootelement.Ifyouaddaschemathatdefinesmorethan
onerootelement,youarepromptedtochoosetherootelementtouseforthenewXML
map.
UsingtheXMLSourcetaskpane
YouusetheXMLSourcetaskpanetomanageXMLmaps.Toopenit,ontheDevelopertab,inthe
XMLgroup,clickSource.Thefollowingdiagramshowsthemainfeaturesofthistaskpane.
1. ListsXMLmapsthatwereaddedtotheworkbook
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage88CopyrightMay2010
2.
DisplaysahierarchicallistofXMLelementsinthecurrentlylistedXMLmap
3.
SetsoptionswhenworkingwiththeXMLSourcetaskpaneandtheXMLdata,suchashow
topreviewthedataandcontrolheadings
4.
OpenstheXMLMapsdialogbox,whichyoucanusetoadd,delete,orrenameXMLmaps
5.
VerifieswhetheryoucanexportXMLdatathroughthecurrentXMLmap
Elementtypesandtheiricons
ThefollowingtablesummarizeseachtypeofXMLelementthatExcelcanworkwithandtheicon
thatisusedtorepresenteachtypeofelement.
Elementtype Icon
Parentelement
Requiredparentelement
Repeatingparentelement
Requiredrepeatingparentelement
Childelement
Requiredchildelement
Repeatingchildelement
Requiredrepeatingchildelement
Attribute
Requiredattribute
Simplecontentinacomplexstructure
Requiredsimplecontentinacomplexstructure
Workingwithsinglemappedcells
AsinglemappedcellisacellthathasbeenmappedtoanonrepeatingXMLelement.Youcreatea
singlemappedcellbydragginganonrepeatingXMLelementfromtheXMLSourcetaskpaneontoa
singlecellinyourworksheet.WhenyoudraganonrepeatingXMLelementontotheworksheet,you
canuseasmarttagtochoosetoincludetheXMLelementnameasaheadingaboveorjusttothe
leftofthesinglemappedcell,oryoucanuseanexistingcellvalueasaheading.Youcanalsousea
formulainasinglemappedcell,ifthecellismappedtoanXMLelementwithanXMLSchema
Definition(XSD)datatypethatExcelinterpretsasanumber,date,ortime.
WorkingwithrepeatingcellsinXMLtables
XMLtablesaresimilarinappearanceandfunctionalitytoExceltables.AnXMLtableisanExceltable
thathasbeenmappedtooneormoreXMLrepeatingelements.EachcolumnintheXMLtable
representsanXMLelement.AnXMLtableiscreatedwhenyou:
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage89CopyrightMay2010
1. UsetheImportcommand(intheXMLgroupontheDevelopertab)toimportanXMLdata
file.
2. UsetheOpencommand(ontheMicrosoftOfficeButton)toopenanXMLdatafileand
thenselectAsanXMLtableintheOpenXMLdialogbox.
3. UsetheFromXMLDataImportcommand(fromtheFromOtherSourcescommandbutton,
intheGetExternalDatagroup,ontheDatatab)toimportanXMLdatafileandthen
selectXMLtableinexistingworksheetorNewworksheetintheImportDatadialogbox.
4. DragoneormorerepeatingelementsfromtheXMLSourcetaskpanetoaworksheet.
5. WhenyoucreateanXMLtable,theXMLelementnamesareautomaticallyusedascolumn
headings.Youcanchangethesetoanycolumnheadingsthatyouwant.However,the
originalXMLelementnamesarealwaysusedwhenyouexportdatafromthemappedcells.
TwooptionsundertheOptionsbuttonintheXMLSourcetaskpaneareusefulwhenyouworkwith
XMLtables:
1. AutomaticallyMergeElementsWhenMappingWhenselected,ExcelcreatesoneXML
tablefrommultiplefieldsastheyaredroppedontotheworksheet.Thisoptionworksaslong
asthemultiplefieldsaredroppedonthesamerow,oneadjacenttotheother.Whenthis
optioniscleared,eachelementappearsasitsownXMLtable.
2. MyDataHasHeadingsWhenselected,existingheadingdataisusedascolumnheadingsfor
repeatingelementsthatyoumaptoyourworksheet.Whenthisoptioniscleared,theXML
elementnamesareusedascolumnheadings.
UsingXMLtables,youcaneasilyimport,export,sort,filter,andprintdatabasedonanXMLdata
source.However,XMLtablesdohavesomelimitationsregardinghowtheycanbearrangedonthe
worksheet.
XMLtablesarerowbased,meaningthattheygrowfromtheheaderrowdown.Youcannotaddnew
entriesaboveexistingrows.YoucannottransposeanXMLtablesothatnewentrieswillbeaddedto
theright.YoucanuseformulasincolumnsthataremappedtoXMLelementswithanXMLSchema
Definition(XSD)datatypethatExcelinterpretsasanumber,date,ortime.JustasinanExceltable,
formulasinanXMLtablearefilleddownthecolumnwhennewrowsareaddedtothetable.
XMLmapsecurityconsiderations
AnXMLmapanditsdatasourceinformationaresavedwiththeExcelworkbook,notaspecific
worksheet.AmalicioususercanviewthismapinformationbyusingaMicrosoftVisualBasicfor
Applications(VBA)macro.Furthermore,ifyousaveyourworkbookasamacroenabledExcelOpen
XMLFormatFile,thismapinformationcanbeviewedthroughMicrosoftNotepadorthrough
anothertexteditingprogram.
Ifyouwanttokeepusingthemapinformationbutremovethepotentiallysensitivedatasource
information,youcandeletethedatasourcedefinitionoftheXMLschemafromtheworkbook,but
stillexporttheXMLdata,byclearingtheSavedatasourcedefinitioninworkbookcheckboxinthe
XMLMapPropertiesdialogbox,whichisavailablefromtheMapPropertiescommandintheXML
groupontheDevelopertab.
Ifyoudeleteaworksheetbeforeyoudeleteamap,themapinformationaboutthedatasources,
andpossiblyothersensitiveinformation,isstillsavedintheworkbook.Ifyouareupdatingthe
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage90CopyrightMay2010
workbooktoremovesensitiveinformation,makesurethatyoudeletetheXMLmapbeforeyou
deletetheworksheet,sothatthemapinformationispermanentlyremovedfromtheworkbook.
ImportingXMLdata
YoucanimportXMLdataintoanexistingXMLmapinyourworkbook.Whenyouimportdata,you
bindthedatafromthefiletoanXMLmapthatisstoredinyourworkbook.Thismeansthateach
dataelementintheXMLdatafilehasacorrespondingelement,intheXMLschema,thatyou
mappedfromanXMLSchemafileorinferredschema.EachXMLmapcanonlyhaveoneXMLdata
binding,andanXMLdatabindingisboundtoallofthemappingsthatwerecreatedfromasingle
XMLmap.YoucandisplaytheXMLMapPropertiesdialogbox(ClickMapPropertiesintheXML
groupontheDevelopertab.),whichhasthreeoptions,allselectedbydefault,thatyoucansetor
cleartocontrolthebehaviorofanXMLdatabinding:
1. ValidatedataagainstschemaforimportandexportSpecifieswhetherExcelvalidatesdata
againsttheXMLmapwhenimportingdata.Clickthisoptionwhenyouwanttoensurethat
theXMLdatathatyouimportconformstotheXMLschema.
2. OverwriteexistingdatawithnewdataSpecifieswhetherdataisoverwrittenwhenyou
importdata.Clickthisoptionwhenyouwanttoreplacethecurrentdatawithnewdata,for
example,whenuptodatedataiscontainedinthenewXMLdatafile.
3. AppendnewdatatoexistingXMLtablesSpecifieswhetherthecontentsofthedatasource
areappendedtotheexistingdataontheworksheet.Clickthisoption,forexample,when
youareconsolidatingdatafromseveralsimilarXMLdatafilesintoanXMLtable,oryoudo
notwanttooverwritethecontentsofacellthatcontainsafunction.
WhenyouimportXMLdata,youmaywanttooverwritesomemappedcellsbutnotothers.For
example,somemappedcellsmaycontainformulasandyoudon'twanttooverwritetheformula
whenyouimportanXMLfile.Therearetwoapproachesthatyoucantake:
1. Unmaptheelementsthatyoudon'twantoverwritten,beforeyouimporttheXMLdata.
AfteryouimporttheXMLdata,youcanremaptheXMLelementtothecellscontainingthe
formulas,sothatyoucanexporttheresultsoftheformulastotheXMLdatafile.
2. CreatetwoXMLmapsfromthesameXMLschema.UseoneXMLmapforimportingtheXML
data.Inthis"Import"XMLmap,don'tmapelementstothecellsthatcontainformulasor
otherdatathatyoudon'twantoverwritten.UseanotherXMLmapforexportingthedata.In
this"Export"XMLmap,maptheelementsthatyouwanttoexporttoanXMLfile.
TheabilitytoimportXMLdatafromaWebservicebyusingaDataRetrievalServiceConnection
(.uxdc)filetoconnecttoadatasourceisnolongersupportedinMicrosoftOfficeExcel2007through
theuserinterface.IfyouopenaworkbookthatwascreatedinOfficeExcel2003,youcanstillview
thedata,butyoucannoteditorrefreshthesourcedata.
Workingwithaninferredschema
IfyouimportXMLdatawithoutfirstaddingacorrespondingXMLschematocreateanXMLmap,
ExceltriestoinferaschemaforyoubasedonthetagsthataredefinedintheXMLdatafile.The
inferredschemaisstoredwiththeworkbook,andtheinferredschemaallowsyoutoworkwithXML
dataifanXMLschemafileisn'tassociatedwiththeworkbook.WhenyouworkwithimportedXML
datathathasaninferredschema,youcanalsocustomizetheXMLSourcetaskpane.Selectthe
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage91CopyrightMay2010
PreviewDatainTaskPaneoptionfromtheOptionsbuttontodisplaythefirstrowofdataassample
dataintheelementlist,ifyouimportedXMLdataassociatedwiththeXMLmapinthecurrent
sessionofExcel.
YoucannotexporttheExcelinferredschemaasaseparateXMLschemadatafile(.xsd).Although
thereareXMLschemaeditorsandothermethodsforcreatinganXMLschemafile,youmaynot
haveconvenientaccesstothemorknowhowtousethem.Asanalternative,youcanusetheExcel
2003XMLToolsAddinVersion1.1,whichcancreateaschemafilefromanXMLmap.Formore
information,seeUsingtheExcel2003XMLToolsAddinVersion1.1.
ExportingXMLdata
YouexportXMLdatabyexportingthecontentsofmappedcellsontheworksheet.Whenyouexport
data,Excelappliesthefollowingrulestodeterminewhatdatatosaveandhowtosaveit:
1. Emptyitemsarenotcreatedwhenblankcellsexistforanoptionalelement,butemptyitems
arecreatedwhenblankcellsexistforarequiredelement.
2. UnicodeTransformationFormat8(UTF8)encodingisusedtowritethedata.
3. AllnamespacesaredefinedintheRootXMLelement.
4. Exceloverwritesexistingnamespaceprefixes.Thedefaultnamespaceisassignedaprefixof
ns0.Successivenamespacesaredesignatedns1,ns2tons<count>where<count>isthe
numberofnamespaceswrittentotheXMLfile.
5. Commentnodesarenotpreserved.
6. YoucandisplaytheXMLMapPropertiesdialogbox(ClickMapPropertiesintheXMLgroup
ontheDevelopertab.)andthenusetheValidatedataagainstschemaforimportand
exportoption(activebydefault)tospecifywhetherExcelvalidatesdataagainsttheXML
mapwhenexportingdata.ClickthisoptionwhenyouwanttoensurethattheXMLdatayou
exportconformstotheXMLschema.
UsingtheExcelMacroenabledOfficeXMLFormatFile
YoucansaveanExcelworkbookinavarietyoffileformats,includingtheExcelmacroenabledOffice
XMLFormatFile(.xlsm).ExcelhasadefinedXMLschemathatdefinesthecontentsofanExcel
workbook,includingXMLtagsthatstoreallworkbookinformation,suchasdataandproperties,and
definetheoverallstructureoftheworkbook.CustomapplicationscanusethisExcelmacroenabled
OfficeXMLFormatFile.Forexample,developersmaywanttocreateacustomapplicationtosearch
fordatainmultipleworkbooksthataresavedinthethisformatandcreateareportingsystembased
onthedatafound.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage92CopyrightMay2010
Chapter8
ExcelQuickTips
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage93CopyrightMay2010
50QuickTips
TheExcelworkbookusedinclasstodemonstratethesequicktipscanbedownloaded
instantlyatthefollowingaddress:www.ExcelAdvisor.netPassword:2007collins
1RightClickStatusBar‐(Viewsums,averages,mins,maxesimmediately)
2CTRL+MouseScroll‐(Zoomin&outwithyourmouse)
3DoubleClicktheFormatPainter‐(Toolsticksuntilclickedagain)
4ReplaceFormatting‐(Findandreplaceoneformattingwithanother)
5ClickonEdgeofCell‐(Navigateinarangeofcells)
6TurnoffTaskPane‐(PutanendtoTaskPane)
7ControlTilde(CTRL+~)‐(Viewunderlyingformulas)
8IndentIcon‐(Indentcellsorcolumnsinstantly)
9ALT+DownArrow(orShiftF10)‐(Pickfromadropdownlist)
10F4‐(Repeatthelastcommandsuchasinsertrowsorchangerowheight)
11Alt+Enter‐(Wraptextinstantly)
12&‐(Combinetextfrommultiplecells)
13RightClickTab,Copy,CreateCopy‐(Insertnewsheetwithheaders,footers,etc)
14File,SendTo,MailRecipient‐(EMailaworksheet,workbookorchart)
15ComboBoxfromFormsToolbar‐(Insertacombobox)
16DoubleClickFillHandle‐(Copiesformuladowntherelevantrange)
17=Upper,=Lower,=Proper‐(Changetextcase)
18PasteSpecial,Values‐(Convertformulastonumbers)
19F4inEditMode‐(ToggleAbsoluteReferences)
20PasteSpecial,Transpose‐(Invertamatrixofnumbers)
21Ctrl+D‐(CopyDatatothedown)
22Ctrl+R‐(Copydatatotheright)
23DefinedNames‐(Refertonamesratherthancelladdresses)
24Data,AutoFilter,Advanced,Copy,Unique‐(Extractuniquevalues)
25Tools,Options,Calculation,PrecisionasDisplayed(Avoidroundingerrors)
26RightClickToolbar,Options,ShowFullMenus‐(Showallmenuoptions)
27Tools,View,ZeroValues‐(Hidezerovalues)
28Tools,AutoCorrect,SmartTags,None‐(TurnoffSmartTags)
29FilterData,ApplyColor,UnfilterData‐(Colorfilteredresults)
30PDF2XL‐($95productconvertsPDF'stoExcelfiles)
31DataValidation‐(Insertapopupcommentintoacell)
32Ctrl+Shft+End‐(Selectrowtotheright)
33Ctrl+Shft+Home‐(Selectrowtotheleft)
34F11‐(Produceaquickchart)
35PrintAreainNameBox‐(Quicklyidentifytheprintarea)
36DisplayingtheStylesTool‐(Toolbaraccesstostyles)
37Format,Styles‐(Createnewstyles)
38ControlPanel,RegionalOptions‐(Controlhowdatesaredisplayed)
39=Substitute‐(Removeorreplaceunwantedcharacters)
40View,SizedwithWindow‐(ResizescharttofitWindow)
41Ctrl+Spacebar‐(Selectacolumn)
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage94CopyrightMay2010
42Shift+Spacebar‐(Selectarow)
43Alt+Tab‐(TogglebetweenapplicationsorExcelworkbooks)
44DeleteBlankRowsandColumns,Ctrl+S‐(Reducerelevantareaandscrollbar)
45CopyFormula,toBlankCells‐(Fillinmissingdatainalist)
46=ISTEXT(A1)‐(Usethisformulainconditionalformattingtoformattextonly)
47Replace,Within‐(Tipforreplacingthroughoutentireworkbook)
48=LEN(A1)LEN(SUBSTITUTE(A1,A2,""))‐(Counttheoccurrenceofacharacter)
49=MID(A25,FIND("*",SUBSTITUTE(A25,"\","*",LEN(A25)
LEN(SUBSTITUTE(A25,"\",""))))+1,LEN(A25))‐(ExtracttheFilename)
50=SumIF‐(Sumonlythosenumbersthatmeetspecificcriteria)
BonusTips20AdditionalExcelTips:
1. =Left
2. =Find
3. =Mid
4. =Right
5. =Len
6. Transitionturnedon
7. Moveoneditturnedoff
8. AutoCorrect
9. RenameTab
10. ColorTab
11. ReorderTabs
12. SelectMultipleTabs
13. Fixeddecimalplaces
14. TurnoffAutoComplete‐Tools,Options,Edit
15. EnterFormatsautomatically
16. Show50/9recentlyusedfiles
17. DefaultFileFormat‐Tools,Options,Transition
18. EmbeddedVoiceclips
19. EmbeddedVideoClips
20. OrganizationCharts

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage95CopyrightMay2010
Chapter9
What’sNewin
Excel2007?
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage96CopyrightMay2010
EnhancementstoExcel2007
1. MoreColumns‐IncreasedthetotalnumberofavailablecolumnsinExcelfrom256(2^8)to
16,000(2^14).
2. MoreRows‐IncreasedthetotalnumberofavailablerowsinExcelfrom64,000(2^16)to
1,000,000(2^20).
3. MoreMemory‐IncreasedthetotalamountofPCmemorythatExcelcanusefrom1GBtoas
muchRAMasWindowssees.
4. DualCoreChips‐OfficeExcel2007supportsmultiplemicrocomputerprocessorsand
multithreadedchipsets.
5. MoreColors‐Excel2007nowsupportsupto16millioncolors,upfrom256.
6. SortbyColor.Wow!
7. MoreSortingCriteria‐Increasedthenumberoflevelsofsortingonarangeortablefrom3to
64.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage97CopyrightMay2010
8. MoreCharactersinacell‐Increasedthetotalnumberofcharactersthatcandisplayinacellby
32fold.Morespecifically,thislimitwasincreasedfrom1k(whenthetextisformatted)to32kor
unlimited(regardlessofformatting).
9. FindMoreitems‐Increasedthemaximumnumberofitemsfoundby“FindAll”from65,472to
2Billion.
10. MorePivotRows‐IncreasedthenumberofrowsallowedinaPivotTablefrom64kto1,000,000
(2^20).
11. ArraysReferenceMoreRows‐Eliminatedthelimitonthenumberofrowsofacolumnor
columnsthatcanbereferredtoinanarrayformula.
12. MoreConditionalFormats‐Increasedthenumberofconditionalformatconditionsonacell
from3conditionstolimitedbyavailablememory.
13. MoreAutoFilterResults‐IncreasedthenumberofitemsshownintheAutoFilterdropdown
from1,000to10,000.
14. PrintMoreCharactersinaCell‐IncreasedthenumberofcharacterspercellthatExcelcanprint
from1kto32k.
15. MoreStyles‐Increasedthetotalnumberofuniquecellstylesinaworkbook(combinationsof
allcellformatting)from4,000to64,000.
16. LargerFormulas‐Increasedthemaximumlengthofformulas(incharacters)from1,000
charactersto8,000characters.
17. MoreFormulaNesting‐IncreasedthenumberoflevelsofnestingthatExcelallowsinformulas
from7to64.
18. MoreArguments‐Increasedthemaximumnumberofargumentstoafunctionfrom30to255.
19. MorePivotColumns‐IncreasedthenumberofcolumnsallowedinaPivotTablefrom255to
16,000.
20. MoreUniquePivotItems‐IncreasedmaximumnumberofuniqueitemswithinasinglePivot
Fieldfrom32,000to1,000,000.
21. MorePivotFields‐Increasedthenumberoffields(asseeninthefieldlist)thatasingle
PivotTablecanhavefrom255to16,000.
22. LongerPivotNames‐IncreasedlengthoftheMDXnameforaPivotTableitem;alsothestring
lengthforarelationalPivotTablefrom255charactersto32,000.
23. BetterPivotTruncation‐Increasedthelengthatwhichfields’labelsaretruncatedwhenadded
toPivotTable;thisalsoincludescaptionlengthlimitationsfrom255to32,000.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage98CopyrightMay2010
24. BetterPartialCalculations‐Increasedthenumberofcellsthatmaydependonasinglearea
beforeExcelmustdofullcalculationsinsteadofpartialcalculations(becauseitcannolonger
trackthedependenciesrequiredtodopartialcalculations)from8,000tolimitedbyavailable
memory.
25. MoreArrayReferences‐Increasedthenumberofarrayformulasinaworksheetthatcanrefer
toanother(given)worksheetfrom65,000tolimitedbyavailablememory.
26. BucketMoreFunctions‐Increasedthenumberofcategoriesthatcustomfunctionscanbe
bucketedintofrom32to255.
27. BetterExternalUpdates‐Increasedthenumberofcharactersthatmaybeupdatedinanon
residentexternalworkbookreferencefrom255to32,000.
28. Themes‐Excelallowsuserstoformatdatabyapplyingathemeusingaspecificstyle.
29. ShareThemes‐Themescanbesharedacrossother2007Officereleaseprograms.Youcanalso
customizeathemestyle.
30. ChartStylesExcelofferspredefinedchartstyles,butyoucannotcreateyourownchartstyles.
31. QuickerStyles‐Excelnowprovidesaquickermethodtoapplyapredefinedcellstyle.
32. BetterConditionalFormatting‐Useconditionalformattingtovisuallyannotateyourdatafor
bothanalyticalandpresentationpurposes.
33. StrongerConditionalFormatting‐Toeasilyfindexceptionsandtospotimportanttrendsinyour
data,youcanimplementandmanagemultipleconditionalformattingrulesthatapplyrichvisual
formattingintheformofgradientcolors,databars,andiconsetstodatathatmeetsthoserules.
Conditionalformatsarealsoeasytoapply—injustafewclicks,youcanseerelationshipsinyour
datathatyoucanuseforyouranalysispurposes.
34. Resizableformulabar‐ Theformulabarautomaticallyresizestoaccommodatelong,complex
formulas,whichpreventstheformulasfromcoveringotherdatainyourworksheet.
35. FunctionAutoComplete‐ FunctionAutoCompletehelpsuserswriteformulasusingtheproper
formulasyntax.
36. StructuredReferences‐Inadditiontocellreferences,suchasA1andR1C1,Excelnowprovides
structuredreferencestonamedrangesandtablesinaformula.
37. EasierAccesstoNamedRanges‐ Excelnamemanagerorganizes,updates,andmanages
multiplenamedrangesinacentrallocation,whichhelpsanyonewhoneedstoworkonyour
worksheetinterpretitsformulasanddata.
38. NewOLAP‐Whenyouworkwithmultidimensionaldatabases(suchasSQLServerAnalysis
Services)ExcelcanuseOLAPformulastobuildcomplex,freeform,OLAPdataboundreports.
NewcubefunctionsareusedtoextractOLAPdata(setsandvalues)fromAnalysisServicesand
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage99CopyrightMay2010
displayitinacell.OLAPformulascanbegeneratedwhenyouconvertPivotTableformulasto
cellformulasorwhenyouuseAutoCompleteforcubefunctionargumentswhenyoutype
formulas.
39. EnhancedFiltering‐Filterdatabycolororbydates,displaymorethan1000itemsinthe
AutoFilterdropdownlist,selectmultipleitemstofilter,andfilterdatainPivotTables.
40. TableEnhancements‐Neworimprovedfunctionalityfortablesincludesthefollowingfeatures:
a. TableHeaderRows‐ Tableheaderrowscanbeturnedonoroff.Whentableheaders
aredisplayed,theystayvisiblewiththedatainthetablecolumnsbyreplacingthe
worksheetheaderswhenyoumovearoundinalongtable.
b. CalculatedColumns‐ Acalculatedcolumnusesasingleformulathatadjustsforeach
row.Itautomaticallyexpandstoincludeadditionalrowssothattheformulais
immediatelyextendedtothoserows.Allthatyouhavetodoisenteraformulaonce—
youdon'tneedtousetheFillorCopycommands.
c. AutomaticAutofiltering‐AutoFilteristurnedonbydefaultinatabletoenable
powerfulsortingandfilteringoftabledata.
d. StructuredReferences‐Thistypeofreferenceallowsyoutousetablecolumnheader
namesinformulasinsteadofcellreferences,suchasA1orR1C1.
e. TotalRows‐Inatotalrow,youcannowusecustomformulasandtextentries.
f. TableStyles‐ Youcanapplyatablestyletoquicklyadddesignerquality,professional
formattingtotables.Ifanalternaterowstyleisenabledonatable,Excelwillmaintain
thealternatingstylerulethroughactionsthatwouldhavetraditionallydisruptedthis
layout,suchasfiltering,hidingrows,ormanualrearrangingofrowsandcolumns.
41. PresentationQualityCharts‐Newchartingtoolstocreateprofessionallookingcharts.Thenew,
uptodatelookforchartsincludesspecialeffects,suchas3D,transparency,andsoftshadows.
42. ChartThemesChartsfollowthethemethatisappliedtoyourworkbook.
43. VisualChartElementPickers‐Quicklychangeeveryelementofthecharttobestpresentyour
data.Forexample,inafewclicks,youcanaddorremovetitles,legends,datalabels,trendlines,
andotherchartelements.
44. AModernlookwithOfficeArt‐ BecausechartsinExcelarenowdrawnwithOfficeArt,almost
anythingyoucandotoanOfficeArtshapecanalsobedonetoachartanditselements.For
example,youcanaddasoftshadoworbeveleffecttomakeanelementstandoutoruse
transparencytomakeelementsvisiblethatarepartiallyobscuredinachartlayout.Youcanalso
userealistic3Deffects.
45. ClearLinesandFonts‐Linesinchartsappearlessjagged,andClearTypefontsareusedfortext
toimprovereadability.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage100CopyrightMay2010
46. ChartTemplates‐Saveyourfavoritechartsasacharttemplate.
47. UsingExcelChartsinOtherPrograms‐ ChartssharedbetweenExcel,Word,andPowerPoint
nowincorporatethepowerfulchartingfeaturesofExcel,includingtheuseofformulas,filtering,
sorting,andtheabilitytolinkacharttoexternaldatasources,suchasMicrosoftSQLServerand
AnalysisServices(OLAP),foruptodateinformationinyourchart.
48. CopyingchartstootherprogramsChartscanbeeasilycopiedandpastedbetweendocuments
orfromoneprogramtoanother.WhenyoucopyachartfromExceltoWordorPowerPoint,it
automaticallychangestomatchtheWorddocumentorPowerPointpresentation,butyoucan
alsoretaintheExcelchartformat.TheExcelworksheetdatacanbeembeddedintheWord
documentorPowerPointpresentation,butyoucanalsoleaveitintheExcelsourcefile.
49. AnimatingchartsinPowerPoint InPowerPoint,youcanmoreeasilyuseanimationto
emphasizedatainanExcelbasedchart.Youcananimatetheentirechartorthelegendentry
andaxislabels.Inacolumnchart,youcanevenanimateindividualcolumnstobetterillustratea
specificpoint.Animationfeaturesareeasiertofindandyouhavealotmorecontrol.For
example,youcanmakechangestoindividualanimationsteps,andusemoreanimationeffects.
50. NewPivotTableControls‐NewPivotTablecontrolsprovidebetterdraganddropzonetargets.
51. NewPivotTableFeatures‐Neworimprovedfeaturesareprovidedtosummarize,analyze,and
formatPivotTabledata.
52. UsingUndoinPivotTables‐ Youcannowundomostactionsthatyoutaketocreateor
rearrangeaPivotTable.
53. PlusandMinusDrillDownIndicators‐ Theseindicatorsareusedtoindicatewhetheryoucan
expandorcollapsepartsofthePivotTabletoseemoreorlessinformation.
54. SortingandfilteringSortingisnowassimpleasselectinganiteminthecolumnthatyouwant
tosortandusingsortbuttons.YoucanfilterdatabyusingPivotTablefilters,suchasdatefilters,
labelfilters,valuefilters,ormanualfilters.
55. Conditionalformatting YoucanapplyconditionalformattingtoanOfficeExcel2007Pivot
Tablebycellorbyintersectionofcells.
56. PivotTablestyleandlayoutJustlikeyoucanforExceltablesandcharts,youcanquicklyapplya
predefinedorcustomstyletoaPivotTable.AndchangingthelayoutofaPivotTableisalsomuch
easiertodointhenewuserinterface.
57. PivotCharts LikePivotTables,PivotChartsaremucheasiertocreateinthenewuserinterface.
AllofthefilteringimprovementsarealsoavailableforPivotCharts.Whenyoucreatea
PivotChart,specificPivotCharttoolsandcontextmenusareavailablesothatyoucananalyzethe
datainthechart.Youcanalsochangethelayout,style,andformatofthechartoritselements
thesamewaythatyoucanforaregularchart.InOfficeExcel2007,thechartformattingthat
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage101CopyrightMay2010
youapplyispreservedwhenyoumakechangestothePivotChart,whichisanimprovementover
thewayitworkedinearlierversionsofExcel.
58. QuickConnectionsToExternalDataInOfficeExcel2007,younolongerneedtoknowtheserver
ordatabasenamesofcorporatedatasources.Instead,youcanuseQuickLaunchtoselectfrom
alistofdatasourcesthatyouradministratororworkgroupexperthasmadeavailableforyou.A
connectionmanagerinExcelallowsyoutoviewallconnectionsinaworkbookandmakesit
easiertoreuseaconnectionortosubstituteaconnectionwithanotherone.
59. NewFileFormatsXmlBasedFileFormat In2007MicrosoftOfficesystem,Microsoftis
introducingnewfileformatsforWord,Excel,andPowerPoint,knownastheOfficeOpenXML
formats.Thesenewfileformatsfacilitateintegrationwithexternaldatasources,andalsooffer
reducedfilesizesandimproveddatarecovery.InOfficeExcel2007,thedefaultformatforan
ExcelworkbookistheOfficeExcel2007XMLbasedfileformat(.xlsx).OtheravailableXMLbased
formatsaretheOfficeExcel2007XMLbasedandmacroenabledfileformat(.xlsm),theOffice
Excel2007fileformatforanExceltemplate(.xltx),andtheOfficeExcel2007macroenabledfile
formatforanExceltemplate(.xltm).
60. OfficeExcel2007binaryfileformatInadditiontothenewXMLbasedfileformats,OfficeExcel
2007alsointroducesabinaryversionofthesegmentedcompressedfileformatforlargeor
complexworkbooks.Thisfileformat,theOfficeExcel2007Binary(orBIFF12)fileformat(.xls),
canbeusedforoptimalperformanceandbackwardcompatibility.
61. CompatibilitywithearlierversionsofExcel YoucancheckanOfficeExcel2007workbookto
seeifitcontainsfeaturesorformattingthatarenotcompatiblewithanearlierversionofExcel
sothatyoucanmakethenecessarychangesforbetterbackwardcompatibility.Inearlier
versionsofExcel,youcaninstallupdatesandconvertersthathelpyouopenanOfficeExcel2007
workbooksothatyoucaneditit,saveit,andopenitagaininOfficeExcel2007withoutlosing
anyOfficeExcel2007specificfunctionalityorfeatures.
62. PageLayoutViewTheNormalviewandPageBreakPreviewview,OfficeExcel2007providesa
PageLayoutView.Youcanusethisviewtocreateaworksheetwhilekeepinganeyeonhowit
willlookinprintedformat.Inthisview,youcanworkwithpageheaders,footers,andmargin
settingsrightintheworksheet,andplaceobjects,suchaschartsorshapes,exactlywhereyou
wantthem.YoualsohaveeasyaccesstoallpagesetupoptionsonthePageLayouttabinthe
newuserinterfacesothatyoucanquicklyspecifyoptions,suchaspageorientation.It'seasyto
seewhatwillbeprintedoneverypage,whichwillhelpyouavoidmultipleprintingattemptsand
truncateddatainprintouts.
63. SavingtoPDFandXPSformatYoucansaveasaPDForXPSfilefroma2007MicrosoftOffice
systemprogramonlyafteryouinstallanaddin.
64. UsingExcelServicestoshareyourworkIfyouhaveaccesstoExcelServices,youcanuseitto
shareyourOfficeExcel2007worksheetdatawithotherpeople,suchasexecutivesandother
stakeholdersinyourorganization.InOfficeExcel2007,youcansaveaworkbooktoExcel
Servicesandspecifytheworksheetdatathatyouwantotherpeopletosee.Inabrowser,they
canthenuseMicrosoftOfficeExcelWebAccesstoview,analyze,print,andextractthis
worksheetdata.Theycanalsocreateastaticsnapshotofthedataatregularintervalsoron
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage102CopyrightMay2010
demand.OfficeExcelWebAccessmakesiteasytoperformactivities,suchasscrolling,filtering,
sorting,viewingcharts,andusingdrilldowninPivotTables.YoucanalsoconnecttheExcelWeb
AccessWebParttootherWebPartstodisplaydatainalternativeways.Andwiththeright
permissions,ExcelWebAccessuserscanopenaworkbookinOfficeExcel2007sothattheycan
usethefullpowerofExceltoanalyzeandworkwiththedataontheirowncomputersifthey
haveExcelinstalled.Usingthismethodtoshareyourworkensuresthatotherpeoplehave
accesstooneversionofthedatainonelocation,whichyoucankeepcurrentwiththelatest
details.Ifyouneedotherpeople,suchasteammembers,tosupplyyouwithcommentsand
updatedinformation,youmaywanttoshareaworkbookthesamewaythatyoudidinearlier
versionsofExceltocollecttheinformationyouneedbeforeyousaveittoExcelServices.
65. UsingDocumentManagementServer ExcelServicescanbeintegratedwithDocument
ManagementServertocreateavalidationprocessaroundnewExcelreportsandworkbook
calculationworkflowactions,suchasacellbasednotificationoraworkflowprocessbasedona
complexExcelcalculation.YoucanalsouseDocumentManagementServertoschedulenightly
recalculationofacomplexworkbookmodel.
66. QuickAccessToMoreTemplatesInOfficeExcel2007,youcanbaseanewworkbookona
varietyoftemplatesthatareinstalledwithExcel,oryoucanquicklyaccessanddownload
templatesfromtheMicrosoftOfficeOnlineWebsite.

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage103CopyrightMay2010
What’sMissinginExcel2007?
WhileitmayappearthatthereisalotofstuffmissinginExcel2007comparedtothe2003edition,
almosteverythingisstillthereyoujustmayneedtolookforitawhiletofindit.Afewofthehard
tofindthingsIhadtroublelocatedwereasfollows:
1. The“CreatePivotTablefromMultiplesources”featureisgonefromtheinsertPivotTable
menu,butyoucanstillfinditbycustomizingyourQuickLaunchtoolbarandaddingthe
“PivotTableandChartWizard”icon.Yuwillseethatthisfunctionalityisstillthere.
2. TheabilitytosendaworksheetasbodyofemailisalsogonefromtheStart,Send,Email
option.butyoucanstillfinditbycustomizingyourQuickLaunchtoolbarandaddingthe
“SendtomailRecipient”icon.Youwillseethatthisfunctionalityisalsostillthere.
3. ThedataFormtoolisstillthereyouhavetoadd“Form”totheQuickAccessToolBar.
4. The“SpeakCells”commandismissingfromtheribbons,butthiscommandisstillavailable
bycustomizingtheQuickLaunchtoolbarandaddingthe“SpeakCells”command.
5. Infactthereareatotalof219commandsinExcelthatdonotappearontheExcelRibbon
youcanviewacompletelistofthesecommandsbycustomizingtheQuickLaunchToolbar
andchoosingtheoptiontoview“CommandsNotintheRibbon”.
However,therearesomethingsthathavedisappearedasfollows:
1. Nomorepublishinginteractivewebpages.
2. EmbeddedvideoclipsandsoundclipsnolongerplaywithinExcel,theyswitchtheuserover
toMediaplayerinstead.
3. TheAutoFormatasweknewitisgone.Ithasbeenreplacedwiththe“FormatasTable”
optionintheStylesgroupoftheHometab,butitdoesmorethanformatyourtable.It
convertsyourtabletowhatExcelusedtocallanExcelList,completewithlistarrowsand
filteroptionsandallkindsofjunkyoureallydon'tneedandprobablydon'twantifyourgoal
isjusttodressupyourdata.Unfortunatelythisnewfunctionalitydoesnotapplyaunique
formattosubtotalrowslikeExcel2003did.Bummer.Thereforeyoumustcollapseyour
rowsinOutline,selectvisiblecells,andapplyadifferentcolor,thenexpandyourrowsagain
topulloffthistypeofformat.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage104CopyrightMay2010
What’sNewin
MicrosoftExcel2010

ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage105CopyrightMay2010
What’sNewinMicrosoftOffice2010?
MicrosofthasannouncedthatitwillbeginshippingOffice2010inSpring2010.Thisbegsthe
question,what’snewinOffice2010?Theshortansweristhatthereareadozenorso
interestingimprovementseachinWord,Excel,PowerPoint,andAccess‐butforthemost
partOffice’scoreproductsareunchanged.ThisisbecausewhenOffice2007wasreleasedin
January2007,thenewmenusonlyappearedin4.5oftheapplicationsWord,Excel,
Access,PowerPointandhalfofOutlook.WithOffice2010,Microsofthasbroughttheother
applicationsuptodatewiththenewermenustyleaswell.Thereforedon’texpecttosee
manydifferencesinWord,Excel,Access,orPowerPoint.However,theseareafew
improvementsOffice2010’scoreproducts,asfollows:
What’sNewinExcel2010?
1. SparklinesSparklinesaresmallcellsizedchartsthatyoucanembedinaworksheet
nexttodatatogetaquickvisualrepresentationofthedata.Forexample,ifyouhad
aworksheetthattrackedtheperformanceofseveraldozenstocks,youcouldcreate
aSparklineforeachstockthatgrapheditsperformanceovertime,inaverycompact
way.Hereisanexample:
2. ConditionalFormattingImprovementsMicrosofthasimprovedandaddedmore
stylesandiconsregardingtheabilitytoapplyaformattoarangeofcells,andthen
havetheformattingchangeaccordingtothevalueofthecellorformula.
3. ImprovedSharingAswithalloftheOffice2010applications,Excel2010hasnew
andimprovedtoolsforsharingdatawithotherpeople,includingmultiplepeople
workingonadocumentatatime.
4. MillionsofRows‐MicrosoftnowoffersProjectGeminiaddonforExcel2010that
canhandleverylargeamountsofdata‐‐evenworksheetsthatincludehundredsof
millionsofrows.ItwillshipaspartofSQLServer2008R2inthefirsthalfof2010;a
communitytechnologypreviewwillbeavailableinthesecondhalfof2009.
5. EnhancedRibbonToolbar‐TheRibbontoolbarhasbeenenhancedtobehighly
customizablenow.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage106CopyrightMay2010
6. Compatibilityof.xlsx‐InExcel2007,MicrosoftintroducedanewXMLformat(.xlsx)which
wasnotcompatiblewithformer.xlsspreadsheetformats.Thisproblemhasbeenresolved‐
ExcelfilescreatedinExcel2010mayeasilybeopenedinversionsofExcelpriortoExcel
2007.NowExcel2010willsavefilesjustassafeastheformerExcel2007,andthe
spreadsheetsizeis75%smallerthantheold.XLSversion.
7.ProtectedMode‐Eachtimeyoudownloadadocument,MicrosoftOffice2010
automaticallyopensitinProtectedModewhichmeansthatExcelwillnotallowyoutoedit
thedocumentsunlessdocumenteditingisenabled.Todothis,clicktheEnableEditing
optioninordertoenabledocumenteditingasshowninthefollowingscreenshot.
7. Slicer‐TheSlicerfeatureprovidesnewsliceanddicecapabilitieswithinPivotTablesthis
helpsyoudynamicallysegmentandfilterthedata.ThisfeatureislocatedontheInsertTab.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage107CopyrightMay2010
8. Macro‐MacrosinExcel2010nowsupportworkingwithshapes,includingcreating,moving
oreditingshapes.
9. EnhancedChartDiagram‐InExcel2010doubleclickingachartelementautomatically
opensthechart’sformatdialogbox.
10. WebVersionofExcel2010AnewwebversionofExcel2010allowsyoutocreate,editand
savespreadsheetviayourwebbrowserdirectlyandsharethemonline.Thewebversion
reportedlywillbeavailableforfreetoeveryonewhohasWindowsLiveaccount.Theweb
versionisassameastheExcel2010ondesktop,withsomeofExcelfunctionalitydisabled.
11. 64bitversionofExcel2010‐Excel2010isnowavailableina64bitversion,whichmeans
thatitcantakefulladvantageofyourcomputer’s64bitmotherboardandaccessmorethan
4GBsofRAM.Theresultisevenfasterperformance.
12. MicrosoftSQLServerPowerPivotforExcel‐Excel2010nowincludesanaddintoolcalled
MicrosoftSQLServerPowerPivotwhichisaBusinessIntelligencetoolthatenablesyouto
querymultipleSQLServerdatabasesacrossmultiplecorporatesystemsandwebdataona
realtimebasistoproducePivotTablesthatcanbesharedviaSharePoint.Youcantrythis
onlineatthefollowingVirtualLabswebsite:
https://cmg.vlabcenter.com/prepare.aspx?moduleid=ad3bd3e98d2b498d94fa
e41e1b09730d&ticks=633992819904236083.
13. NamedSets‐NamedSetshavebeenaddedtoMicrosoftExcel2010,allowsyoutocreate
yourownnamedsets.SimplylocatetheFields,Items,&SetsbuttonundertheRibbon,and
itwillallowyoutodefineyourownNamedSets.
ExcelFunctions,Macros&DataCommands
www.CarltonCollins.comPage108CopyrightMay2010
BioforJ.CarltonCollins,CPA
ASAResearchCarlton@ASAResearch.com770.734.0950
J.CarltonCollins,CPAisaCertifiedPublicAccountantwithexperienceintechnology,
tax,auditing,accountingsystems,financialreporting,andbondfinancing.Heisan
author,lecturer,andtechnology&accountingsystemsconsultant.Hehaspublished
morethantwodozenbooks,twohundredarticles,andthousandsofwebpages.Asa
publicspeaker,Mr.Collinshasdeliveredmorethan2,000lecturesin44statesand5
countriesaddressingmorethan500,000businessprofessionals,includingnumerous
keynotelecturesatnationalandinternationalconferences.Keyawardsinclude:"AICPALifetimeAchievement
Award","TomRadcliffeOutstandingDiscussionLeaderAward","GSCPAOutstandingDiscussionLeaderAward",
and"AccountingTechnologies'TopTenCPATechnologistsAward".Asaconsultant,Mr.Collinshasassisted275+
largeandsmallcompanieswiththeselectionandimplementationofaccountingsystems.Mr.Collinshasa
BachelorsdegreeinAccountingfromtheUniversityofGeorgia,isa26yearmemberoftheAICPAandtheGeorgia
SocietyofCPAs,andisalsoalicensedrealtor.
AttheUniversityofGeorgiaMr.CollinswaselectedPresidentofthePhiEtaSigmaHonorSociety,wasinitiatedinto
theBIFTADHonorSociety,wasamemberofAlphaTauOmegafraternity,andservedthreeyearsintheJudicial
Defender/Advocateprogram.AtGlynnAcademyHighSchoolMr.CollinswasSeniorClassPresident,Class
Valedictorian,andreceivedaprinciplenominationtoAnnapolisNavalAcademy.Mr.Collinshasbeenmarriedfor
25yearsandhastwochildren.Hedevoteshisleisuretimetofamily,travel,tennis,fishing,snowskiing,andriding
motorcycles(dirtandstreet).Mr.Collinsispresidentofhishomeownersassociation,participatesintheGwinnett
CleanandBeautifulprogram,andvolunteersforCooperativeMinistriesfooddrive.
SelectedPositions,Awards&Accomplishments:
1. 2008and2009ChairmanoftheSoutheastAccountingShow‐thesouth'slargestCPAevent.
2. Recipientofthe2008TomRadcliffOutstandingDiscussionLeaderAward.
3. Named“TopTenCPATechnologists”byAccountingTechnologiesMagazine;Named“Top100Most
InfluentialCPAsbyAccountingTechnologiesMagazineinmultipleyears.
4. Haspersonallydeliveredover1,500technologylecturesaroundtheworld.
5. Haspublished80+pagesofaccountingsoftwarearticlesintheJournalofAccountancy.
6. RecipientoftheAICPALifetimeTechnicalContributiontotheCPAProfessionAward.
7. RecipientoftheOutstandingDiscussionLeaderAwardfromtheGeorgiaSocietyofCPAs.
8. LeadauthorforPPC'sGuidetoInstallingMicrocomputerAccountingSystems.
9. Hasinstalledaccountingsystemsformorethan200companies.
10. PastChairpersonoftheAICPATechnologyConference.
11. Hasdeliveredkeynoteandsessionlecturesatdozensofaccountingsoftwareconferencesincludingseven
MicrosoftPartnerConferences,fiveSageConferences,andmultipleconferencesforEpicor,Open
Systems,ExactSoftware,SageACCPACERP,Dynamics.NAV,Dynamics.AX,SouthWare,Axapta.
12. Hasprovidedconsultingservicestomanycomputercompanies(includingCompaq,IBM,Microsoft,Apple,
Novell,Peachtree,Epicor,SageSoftware,Exact,ACCPAC,Intuit,Peachtree,GreatPlains,andothers).
AsanauditorMr.Collinshasauditedbusinessesintheareasofhealthcare,construction,distribution,automobile
dealerships,insurance,manufacturing,andgeneralbusiness. Mr.Collins'taxexperienceincludescorporate,
individual,partnership,fiduciary,andestatetaxplanningwork. Intheareaoffinance,Mr.Collinshasprepared
feasibilitystudiesandfinancialforecastsfornearly300projectsseekingmorethan$3billioninstartupcapital,
includingfieldworkfor80ofthoseprojects.Mr.Collinsisfamiliarwithbondissues,MedicareandMedicaid
reimbursement,andconventionalfinancingmatters.Asaconsultant,Mr.CollinsworkedwiththeentireMicrosoft
Exceldevelopmentteamcontributingmorethan500pagesofdesignimprovements‐manyofwhicharefoundin
Exceltoday.

Navigation menu