Professional Documents
Culture Documents
EXCEL FOR
AD V A N C E D
USERS
J. Carlton Collins
ASA Research - Atlanta, Georgia
770.734.0950
Carlton@ASAResearch.com
TableofContents
CourseInformation......................................................................................3
Chapter1ExcelAdvancedConcepts..........................................................4
Chapter2Excel&theInternet...................................................................9
Chapter3Functions.................................................................................18
Chapter4The=IFFunctions.....................................................................37
Chapter5UsingFunctionstoClean&Crunchdata.................................42
Chapter6DataCommands......................................................................58
Chapter7Macros.....................................................................................95
Chapter8Solver.....................................................................................100
Chapter9ExampleCaseStudies............................................................103
1. GanttChart
104
2. ComboChart
105
3. OrganizationalChart
106
4. PortfolioInvestmentMixandPerformanceTracking
107
Chapter10DiggingDeeperintoExcelsFundamentals..........................122
Chapter11XML......................................................................................128
Chapter12UsingExcelwithYourAccountingSystem...........................136
AppendixInstructorsBiography............................................................173
CourseEvaluationForm............................................................................175
www.ExcelAdvisor.net
Page2
CopyrightMarch2010
2010ExcelAdvanced
CourseInformation
LearningObjectives
ToincreasetheproductivityofaccountantsandCPAsusing
ExcelbyintroducingthemtoadvancedcapabilitieswithinExcel
Advanced
GoodFamiliaritywithMicrosoftExcel
None
LivelectureusingfullcolorprojectionsystemsandliveInternet
accesswithfollowupcoursematerials
CourseLevel
PreRequisites
AdvancedPreparation
PresentationMethod
RecommendedCPECredit
Handouts
Instructors
8hours
Templates,checklists,webexamples,manual
J.CarltonCollins,CPA
AdvisorCPEisregisteredwiththeNationalAssociationofState
Boards of Accountancy (NASBA) as a sponsor of continuing
professional education on the National Registry of CPE
Sponsors. State boards of accountancy have final authority on
theacceptanceofindividualcoursesforCPEcredit.Complaints
regardingregisteredsponsorsmaybeaddressedtothenational
Registry of CPE Sponsors, 150 Fourth Avenue, Nashville, TN,
372192417.Telephone:6158804200.
CopyrightJune2010,AdvisorCPEandAccountingSoftwareAdvisor,LLC
4480MissendellLane,Norcross,Georgia30092770.734.0450
Allrightsreserved.Nopartofthispublicationmaybereproducedortransmittedinanyformwithouttheexpress
written consent of AdvisorCPE, a subsidiary of ASA Research. Request may be emailed to
marylou@advisorcpe.com or further information can be obtained by calling 770.734.0450 or by accessing the
AdvisorCPEhomepageat:http://www.advisorcpe.com/
Alltradenamesandtrademarksusedinthesematerialsarethepropertyoftheirrespectivemanufacturersand/or
owners.Theuseoftradenamesandtrademarksusedinthesematerialsarenotintendedtoconveyendorsement
of any other affiliations with these materials. Any abbreviations used herein are solely for the readers
convenience and are not intended to compromise any trademarks. Some of the features discussed within this
manualapplyonlytocertainversionsofExcel,andfromtimetotime,Microsoftmightremovesomefunctionality.
Microsoft Excel is known to contain numerous software bugs which may prevent the successful use of some
featuresinsomecases.AdvisorCPEmakesnorepresentationsorwarrantywithrespecttothecontentsofthese
materialsanddisclaimsanyimpliedwarrantiesofmerchantabilityoffitnessforanyparticularuse.Thecontentsof
thesematerialsaresubjecttochangewithoutnotice.
ContactInformation:
J.CarltonCollins
carlton@asaresearch.com
770.734.0950
www.ExcelAdvisor.net
Page3
CopyrightMarch2010
Chapter 1
Excel Advanced
Concepts
www.ExcelAdvisor.net
Page4
CopyrightMarch2010
1. EMailMergefromExcel
a. Demonstrate
2. Validation
a. DropDownList
b. Dates,WholeNumbers,Decimals
c. Comments
Also:
a. ColorofDataInputCells
b. =TODAY
c. =VLOOKUP
d. Macro&MacroButtons
3. Macros
a. CreatePageSetupMacro
a. Simplyturnonmacrorecording,presskeys,turnoffmacrorecording
b. NoSpacesallowedinmacroname
c. Assignmacrotoiconorobjectforeasyaccess
b. Recordinworkbookvs.personalmacroworkbook
c. Absolutevs.relativereference
d. CreateanEraseMacro
e. CreateaPrintMacro
f. CreateMacroButtons
g. ShowDeveloperTab
h. IntroductiontoVBA(Nottoodeep)
i. InsertVBAelementsintoExcelComboBox
j. DisplaystheMacrodialogboxALT+F8
k. DisplaystheVisualBasicEditorALT+F11
4. Hyperlinks
a. Text
b. Objects
c. TextBox
d. Icons
e. ToWebSites
f. ToEmailAddresses
g. ToBookmarks
h. ToOtherFiles
5. AdministrativePage
a. Title,Company,Date,Notes,ReviewNotes,Etc.
b. TableofContents(Linkedtoworksheets,namedrangesandotherdocuments)
c. MacroButtons
www.ExcelAdvisor.net
Page5
CopyrightMarch2010
6. Protection
a. LockedCells
b. HiddenCells
c. ProtectSheet(ReviewRibbon)
d. ProtectSheetOptions
7. Encryption(PasswordProtection)
a. SaveAs,Tools,GeneralOptions(InExcel2003)
b. 40Bitvs128Bit(in2003Only)
c. ExplainingBitsandEncryption
8. FormulaAuditing
a. CTRL+~
b. FormulaAuditingToolBar
c. Precedents&D
d. Dependents
e. Linkstootherworksheetsorworkbooks
9. GanttChart
a. Startbycreatingastackedbarchart
b. RemovetheDataSeriesbyrightmouseclickingandchoosingSelectDataSource
c. AddanewDataSourceNamedStartingDate,andpointtotherangeofstartdates
forthevalues
d. AddanothernewdatasourcenamedDuration(Days),andpointtotherangeof
durationdaysforthevalues
e. AddCategoryAxisLabelsandpointtotheTasknamesinColumnA
f. RemovelegendbyselectinglegendandpressingtheDeletekey
g. ClickonthebeginningseriesandsettheFillandBorderstoNone
h. Rightmouseclickonthetasklabels,chooseformatAxis,andchecktheCategories
inReverseOrderbox(ifneeded)
i. Intwoblankcells,writeaformulareferencingthestartandenddates,convert
thesedatestonumberswithformatting
j. UsetheresultingnumberstosetthescaleoftheGanttChart(perhapsusea
slightlylargerrangeofdates)
k. Rightmouseclickonthedaterange,settheminimumandmaximumstofixed
usingthenumbersacquiredintheabovestep
l. Formatthedaterangetoshowashortdate
m. Formattheremainingdatabarstodisplaya3Dbevel
n. Foraddedtouch,searchGoogleimagesforanicepictureofahouse,saveitto
yourharddrive.
o. Setthebackgroundplotareatopicture,andwashoutthepictureenoughsothat
thechartisstillreadable.
p. AddatitleortextboxesasneededtocompletethedescriptionoftheGanttChart
www.ExcelAdvisor.net
Page6
CopyrightMarch2010
10. WebQueries
a. StockPortfolioExample
b. LinktoTickerSymbols
c. LinkResultstoPortfolio
d. Refresh
e. RefreshAll
11. PrecisionasDisplayed
a. Example
b. WorstDialogBox
c. AutoRoundingandTruncating
12. LinearRegressionAnalysis
a. SimpleExample
b. LinearRegressionExplained
c. MoreComplexExample
13. Tabs
a. Rename
b. Color
c. Reorder
d. SelectMultiple
e. DuplicatewithCTRL+Drag
14. Excel2007
a. ThreeCategoriesofImprovements
a. LargerCapacity
b. Newmenus
c. PresentationQualityOutput
b. Demonstrate:
a. RecentDocuments
b. PushPins
c. DataBarFormatting
d. TrafficLightFormatting
e. PictureSupport
f. ChartImprovements
g. AnimateExcelChartsinPPTbySeries
h. SmartArt
i. NewHeaders&FootersControls
j. ContextualMenus
k. QuickAccessToolBar
l. PDFversusXPSformats
www.ExcelAdvisor.net
Page7
CopyrightMarch2010
m. WatchWindow
15. SetupOptions
a. Alwaysshowfullmenus
b. Uncheckmoveonenter
c. Turnontransitionkeyssohomekeytakesyouhome
16. FillinMissingData
a.Bycopyingformulatoblankcells
b.SimpleExample
c.QuickBooksExample
17. OLEObjectLininganEmbedding(OLE)
a. SimpleExampleOrganizationalChart
b. SimpleExampleWaveSound
c. SimpleExampleVideoClip
d. ExcelembeddedintoWord
e. WordEmbeddedintoExcel
18. FileLinking
a. Copypaste
b. CopypasteLink
c. CopypasteLinkasPicture
d. CopypasteasObject
19. SUMIF
20. VLOOKUPExample
21. LoanAmortizationScheduleexample
22. ConsolidateSimilarBudgetsExample
23. ConsolidateDisSimilarBudgetsExample
24. ScenarioManager
25. Solver
26. GetExcel2007for$299ActionPack
27. ComboCharts
www.ExcelAdvisor.net
Page8
CopyrightMarch2010
Chapter 2
www.ExcelAdvisor.net
Page9
CopyrightMarch2010
EXCELANDTHEINTERNET
Listedbeloware9goodwaysinwhichExcelandtheInternetcanworktogether,asfollows:
1. Copy/PasteInternetdataintoExcel(SimpleIknow,butthereareafewtricks).
2. EMailpartofanExcelfileacrosstheInternet.
3. EMailtheentireExcelfileacrosstheInternet.
4. SaveanExcelFiletotheInternet(AgoodwaytosharealargeExcelfile).
5. PublishpartofanExcelfileasanwebpage.
6. PublishanentireExcelfileasawebpage.
7. PublishanentireExcelfileasawebpagewithAutorepublishing
8. WebQueriesLinkingInternetDatatoExcel.
9. EmbeddedHyperlinks(towebpages,emailaddresses)
Thesebulletpointsarediscussedinmoredetailbelow.
Copy/PasteInternetDataintoExcelAsanexercise,searchthewebforyourfavoriteFootball
team roster on rivals.com. Copy and paste the schedule into Excel. Now tell me how many
playerscame from each state andwhat the average weight is for each position. Simple huh?
Herearefivepointerstokeepinmind:
Selectinginternetdatafromthebottomrighttotheupperleftisusuallyeasierthanthe
otherwayaround.
Making columns wider before pasting Internet data into Excel keeps the row heights
fromtakingoff.
Eliminatinghyperlinksindataisusuallyfasterifyoucopyandpastespecialasvaluesto
anotherblankcolumn.
Often you must parse Internet data before you can manipulate it. Do this using the
=Left,=Find,=MID,and=RIGHTfunctions.
Onceparsed,turnonautofiltersandapplythesubtotalingcommandtoyieldtheresults
youseek.
www.ExcelAdvisor.net
Page10
CopyrightMarch2010
EMail part of an Excel file across the Internet Excel provides the ability to email a single
worksheetwithinaworkbookasanemail.ThisfeatureisfoundintheFile,SendTomenuof
excel2003andearlier,andisanonribbontoolwhichyoumustaddtotheQuickAccessTool
barinExcel2007andlater.HereswhatthetoollookslikeinalleditionsofExcel.
EMailtheentireExcelfileacrosstheInternetOfcoursethissametoolmentionedabovecan
beusedtoemailtheentireExcelfileaswell.Thedifferenceisthatwiththisoption,theExcel
workbookarrivesattherecipientasacompletestandaloneexcelfilewhichtherecipientcan
open.Whenaworksheetissentinthismanner,itarrivesasatableinthebodyoftheemail
therearenoformulas,justnumbers.
Save an Excel File to the Internet Another option is to simply save a passwordprotected
Excelfiletoawebserver.ThisisaccomplishedusingtheSaveasfunction,andspecifyingthe
server where the file is to be saved. Of course you will valid user name and password to
completethetransactionasshowbelow.Theprimaryadvantagetothismethodisthatitallows
youtosharealargeExcelfilethatistoobigtobesentviaemail(mostemailservicesprohibit
attachmentsgreaterthan10MBs.ThisapproachalsoallowsyoutoshareyourExcelfilewith
others,orevenwithyourselfifyouplantoworkonthefilefurtherfromyourhomecomputer.
PublishPartofanExcelfileasanWebPageExcelenablesyoutopublishaselectionofcells
asawebpageinanHTMLformat.Todothis,simplychangetheSaveAsTypetoWebPage
asshowninthescreenbelow.
www.ExcelAdvisor.net
Page11
CopyrightMarch2010
Ofcoursetoaccomplishthistask,youwillneedaccesstowebsiteviausernameandpassword.
PublishanentireExcelfileasaWebPageExcelcanalsoautomaticallyconvertyourentire
workbooktoanHTMLpageformatandpublishittothewebsavingyoualargeamountof
timeintheprocess.
SpecialNotere:PasswordprotectingDataontheInternetWhenpublishingExceldataasa
webpage,thereisnoExceloptionforpasswordprotectingthedata,butyoucanachievethe
same results by saving the publishing the data to a password protected folder on your web
server.Todothis,useawebpublishingtool(suchasDreamweaverorExpressionWeb)toopen
yourwebserver.Createanewfolderandconvertittoasubweb.Nowyoucanusethetools
www.ExcelAdvisor.net
Page12
CopyrightMarch2010
optionstoapplypermissionstothatfolder.(CaveatonlyUNIXbasedwebserversallowyouto
applythesetypeofpermissions,Windowsbasedwebserversdonot).
WebQueriesExcelincludespredesignedqueriesthatcanimportcommonlyuseddatain10
seconds.Forexample,youcoulduseawebquerytocreateastockportfolio.Allyouneedisa
connectiontotheInternetandofcourse,somestocktickersymbols.InExcel2003selectData,
ImportExternalData,ImportDataandwalkthroughthewebquerywizardforimportingstock
quotes.InExcel2007andlaterusetheDataRibbon,ExistingConnections,StockQuotesoption.
Inseconds,Excelwillretrieve20minutedelayedstockpricesfromtheweb(duringthehours
when the stock market is open) and display a grid of complete uptodate stick price
informationthatissynchronizedtothestockmarketschangingstockprices.Witheachclickof
theRefreshbutton,thestockpriceinformationinExcelisupdatedthissurebeatspicking
numbersoutofthenewspaper.
CompletingtheStockPortfolioNextlinkthegriddatatoanotherworksheet,andinsertnew
columnscontainingthenumberofsharesowned,aswellsasanadditionalcolumntocomputer
thetotalvaluebasedonsharesowned,asshownbelow.
www.ExcelAdvisor.net
Page13
CopyrightMarch2010
Refreshing the Stock Prices Once you have created your portfolio, simply click the Refresh
DatabuttonontheExternalDataToolbarinExcel2003orontheDataRibboninExcel2007
shownbelowtoupdatethecurrentvalueofyourPortfolio.
QueryParametersTherearenumerousoptionstohelpyouextractexactlythedatayouwant
they way you want it. The Web Query Parameters Box, Web Query Options box and
ExternalDataPropertiesBoxprovidenumerousoptionsforcontrollingyourwebquery.
Query Any Web Page You can query any web page on the web using the new web Query
Option.Allowmetodemonstrateasimpleexample.
Embedded Hyperlinks Another way to use Excel with the Internet is to inset hyperlinks to
webpagesoremailaddresses.NoticeincellC7thatIhaveinsertedmultipleemailaddresses
yesthisworksjustfine.
MicrosoftExcelHistory
www.ExcelAdvisor.net
Page14
CopyrightMarch2010
Microsoft began selling a spreadsheet application called Multiplan in 1982 for CP/M systems
like the Osboune computer. However, on the MSDOS platform Lotus 123 was the market
leader. Microsoft released Excel for the Mac in 1985, and Excel for Windows version in
November,1987.LotuswasslowtoreleaseaWindowsversionof123andby1988Excelwas
outselling 123. Later IBM purchased Lotus Development Corporation and is typical with
software owned by IBM, the products presence diminished in the marketplace. Officially the
currentversionfortheWindowsplatformisExcel12,alsocalledMicrosoftOfficeExcel2007.
ThecurrentversionfortheMacOSXplatformisMicrosoftExcel2008.
MicrosoftExcel2.1includedaruntimeversionofWindows2.1
AFewCommentsaboutExcel:
1. Trademark Dispute In 1993, another company that was already selling a software
packagenamed"Excel"inthefinanceindustryExcelbecamefiledatrademarklawsuit.
Eventually, this forced Microsoft to refer to the program as "Microsoft Excel". Later
Microsoftpurchasedthetrademarkrights.
2. FormattingExcelwasthefirstelectronicspreadsheetthatallowedtheusertodefine
theappearanceofspreadsheets(fonts,characterattributesandcellappearance).
www.ExcelAdvisor.net
Page15
CopyrightMarch2010
4. VBASince1993,ExcelhasincludedVisualBasicforApplications(VBA),aprogramming
languagebasedonVisualBasicwhichaddstheabilitytoautomatetasksinExcelandto
provideuserdefinedfunctions(UDF)foruseinworksheets.VBAallowsthecreationof
formsandinworksheetcontrolstocommunicatewiththeuser.Thelanguagesupports
use (but not creation) of ActiveX (COM) DLL's; later versions add support for class
modulesallowingtheuseofbasicobjectorientedprogrammingtechniques.
File Formats Until 2007 Microsoft Excel used a proprietary binary file format called Binary
Interchange File Format (BIFF) as its primary format. Excel 2007 uses Office Open XML as its
primary file format, an XMLbased format that followed after a previous XMLbased format
called "XML Spreadsheet" ("XMLSS"), first introduced in Excel 2002. The latter format is not
abletoencodeVBAmacros.AlthoughsupportingandencouragingtheuseofnewXMLbased
formats as replacements, Excel 2007 remained backwardscompatible with the traditional,
binaryformats.Inaddition,mostversionsofMicrosoftExcelcanreadCSV,DBF,SYLK,DIF,and
otherlegacyformats.SupportforsomeolderfileformatswereremovedinExcel2007.Thefile
formatsweremainlyfromDOSbasedprograms.
5. Binary Microsoft made the specification of the Excel binary format specification
available on request, but since February 2008 programmers can freely download the
.XLSformatspecificationandimplementitundertheOpenSpecificationPromisepatent
licensing.[
Standardfileextensions:
Format
Extension Description
Spreadsheet .xls
Addin
(VBA)
.xla
Addscustomfunctionality;writteninVBA
Toolbar
.xlb
Chart
.xlc
Dialog
.xld
Archive
.xlk
Addin(DLL) .xll
Macro
.xlm
Template
.xlt
Module
.xlv
Workspace .xlw
www.ExcelAdvisor.net
ArrangementofthewindowsofmultipleWorkbooks
Page16
CopyrightMarch2010
6. OfficeOpenXMLMicrosoftExcel2007,alongwiththeotherproductsintheMicrosoft
Office2007suite,introducesahostofnewfileformats.TheseformpartoftheOffice
OpenXML(OOXML)specification.
NewExcel2007formats
Format
Extension Description
Excel
Workbook
.xlsx
AsExcelWorkbook,butwithmacrosupport.
ExcelAddin
.xlam
Software Errors Criticisms of spreadsheets in general also apply to Excel. See Spreadsheet
shortcomings. Errors specific to Excel include accuracy, date problems and the Excel 2007
displayerror.
8. Date Problems Excel incorrectly treats 1900 as a leap year. The bug originated from
Lotus 123, and was purposely implemented in Excel for the purpose of backward
compatibility. This legacy has later been carried over into Office Open XML file
format.[citationneeded]Excelalsosupportstheseconddateformatbasedonyear1904
epoch.TheExcelDATE()functioncausesproblemswithayearvaluepriorto1900.
www.ExcelAdvisor.net
Page17
CopyrightMarch2010
Chapter3
Functions
www.ExcelAdvisor.net
Page18
CopyrightMarch2010
IntroductiontoExcelFunctions
ExcelFunctionsarepreprogrammedcommandsthatmakethetaskofwritingcomplexformulaseasier.Therearea
totalof333functionsinExcel.Thesefunctionsareseparatedinto11categoriesasfollows:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
DatabaseFunctions(12)
DateandTimeFunctions(20)
EngineeringFunctions(39)
FinancialFunctions(53)
InformationFunctions(17)
LogicalFunctions(6)
LookupandReferenceFunctions(18)
MathandTrigonometryFunctions(59)
StatisticalFunctions(80)
TextFunctions(27)
ExternalFunctions(2)
Some Excel functions are more powerful than others and some are more relevant to the CPA than others. For
example,mostCPAswillfindtheIF,SUM,COUNT,SUBTOTAL,TEXT,andVLOOKUPareveryrelevanttotheCPA
while other engineering and trigonometry functions such as LOG, PI, RADIENS, DELTA, TAN, COMPLEX, and
HAX2DECaretypicallylessrelevanttoCPAs.Ithasbeenmyexperiencethatthefollowing67functionsaremost
relevanttotheCPA;thereforeCPAswishingtoincreasetheircommandofExcelfunctionsshouldconcentrateon
thesefunctionsfirst.
CarltonsListofTheTop67FunctionsMostRelevanttoCPAs
SortedByCarltonsOpinionoftheMostUseful
1.
6.
11.
16.
21.
26.
31.
36.
41.
46.
51.
56.
61.
66.
IF
AVERAGE
VLOOKUP
LOWER
REPLACE
SUBSTITUTE
DAY
ROUNDUP
PERCENTILE
DCOUNT
TIME
ERROR.TYPE
HYPERLINK
CONFIDENCE
2.
7.
12.
17.
22.
27.
32.
37.
42.
47.
52.
57.
62.
67.
SUM
COUNTBLANK
HLOOKUP
LEFT,LEFTB
CONCATENATE
NOW
YEAR
MAX
PERCENTRANK
DCOUNTA
FV
INFO
TRANSPOSE
REPT
3.
8.
13.
18.
23.
28.
33.
38.
43.
48.
53.
58.
63.
SUMIF
COUNTIF
LOOKUP
MID,MIDB
CLEAN
TODAY
WEEKDAY
MIN
PMT
AND
IRR
ISBLANK
ABS
4.
9.
14.
19.
24.
29.
34.
39.
44.
49.
54.
59.
64.
5.
10.
15.
20.
25.
30.
35.
40.
45.
50.
55.
60.
65.
COUNT
VALUE
TRIM
RIGHT,
UPPER
MONTH
ROUND
MEDIAN
NPV
OR
YIELD
ISNA
RAND
COUNTA
TEXT
PROPER
FIND,FINDB
LEN,LENB
DATE
ROUNDDOWN
MODE
DSUM
CHOOSE
CELL
GETPIVOTDATA
RANDBETWEEN
FollowingisalistofallExcelfunctions,organizedbycategory,includingadescriptionofeachfunction.
www.ExcelAdvisor.net
Page19
CopyrightMarch2010
DatabaseFunctions
Function
Description
DAVERAGE
Returnstheaverageofselecteddatabaseentries
DCOUNT
Countsthecellsthatcontainnumbersinadatabase
DCOUNTA
Countsnonblankcellsinadatabase
DGET
Extractsfromadatabaseasinglerecordthatmatchesthespecifiedcriteria
DMAX
Returnsthemaximumvaluefromselecteddatabaseentries
DMIN
Returnstheminimumvaluefromselecteddatabaseentries
DPRODUCT
Multipliesthevaluesinaparticularfieldofrecordsthatmatchthecriteriain
adatabase
DSTDEV
Estimatesthestandarddeviationbasedonasampleofselecteddatabase
entries
DSTDEVP
Calculatesthestandarddeviationbasedontheentirepopulationofselected
databaseentries
10
DSUM
Addsthenumbersinthefieldcolumnofrecordsinthedatabasethatmatch
thecriteria
11
DVAR
Estimatesvariancebasedonasamplefromselecteddatabaseentries
12
DVARP
Calculatesvariancebasedontheentirepopulationofselecteddatabase
entries
DateandTimeFunctions
Function
Description
13
DATE
Returnstheserialnumberofaparticulardate
14
DATEVALUE
Convertsadateintheformoftexttoaserialnumber
15
DAY
Convertsaserialnumbertoadayofthemonth
16
DAYS360
Calculatesthenumberofdaysbetweentwodatesbasedona360dayyear
17
EDATE
Returnstheserialnumberofthedatethatistheindicatednumberofmonths
www.ExcelAdvisor.net
Page20
CopyrightMarch2010
beforeorafterthestartdate
18
EOMONTH
Returnstheserialnumberofthelastdayofthemonthbeforeoraftera
specifiednumberofmonths
19
HOUR
Convertsaserialnumbertoanhour
20
MINUTE
Convertsaserialnumbertoaminute
21
MONTH
Convertsaserialnumbertoamonth
22
NETWORKDAYS
Returnsthenumberofwholeworkdaysbetweentwodates
23
NOW
Returnstheserialnumberofthecurrentdateandtime
24
SECOND
Convertsaserialnumbertoasecond
25
TIME
Returnstheserialnumberofaparticulartime
26
TIMEVALUE
Convertsatimeintheformoftexttoaserialnumber
27
TODAY
Returnstheserialnumberoftoday'sdate
28
WEEKDAY
Convertsaserialnumbertoadayoftheweek
29
WEEKNUM
Convertsaserialnumbertoanumberrepresentingwheretheweekfalls
numericallywithayear
30
WORKDAY
Returnstheserialnumberofthedatebeforeorafteraspecifiednumberof
workdays
31
YEAR
Convertsaserialnumbertoayear
32
YEARFRAC
Returnstheyearfractionrepresentingthenumberofwholedaysbetween
start_dateandend_date
EngineeringFunctions
Function
Description
33
BESSELI
ReturnsthemodifiedBesselFunctionIn(x)
34
BESSELJ
ReturnstheBesselFunctionJn(x)
35
BESSELK
ReturnsthemodifiedBesselFunctionKn(x)
www.ExcelAdvisor.net
Page21
CopyrightMarch2010
36
BESSELY
ReturnstheBesselFunctionYn(x)
37
BIN2DEC
Convertsabinarynumbertodecimal
38
BIN2HEX
Convertsabinarynumbertohexadecimal
39
BIN2OCT
Convertsabinarynumbertooctal
40
COMPLEX
Convertsrealandimaginarycoefficientsintoacomplexnumber
41
CONVERT
Convertsanumberfromonemeasurementsystemtoanother
42
DEC2BIN
Convertsadecimalnumbertobinary
43
DEC2HEX
Convertsadecimalnumbertohexadecimal
44
DEC2OCT
Convertsadecimalnumbertooctal
45
DELTA
Testswhethertwovaluesareequal
46
ERF
ReturnstheerrorFunction
47
ERFC
ReturnsthecomplementaryerrorFunction
48
GESTEP
Testswhetheranumberisgreaterthanathresholdvalue
49
HEX2BIN
Convertsahexadecimalnumbertobinary
50
HEX2DEC
Convertsahexadecimalnumbertodecimal
51
HEX2OCT
Convertsahexadecimalnumbertooctal
52
IMABS
Returnstheabsolutevalue(modulus)ofacomplexnumber
53
IMAGINARY
Returnstheimaginarycoefficientofacomplexnumber
54
IMARGUMENT
Returnstheargumenttheta,anangleexpressedinradians
55
IMCONJUGATE
Returnsthecomplexconjugateofacomplexnumber
56
IMCOS
Returnsthecosineofacomplexnumber
57
IMDIV
Returnsthequotientoftwocomplexnumbers
58
IMEXP
Returnstheexponentialofacomplexnumber
59
IMLN
Returnsthenaturallogarithmofacomplexnumber
www.ExcelAdvisor.net
Page22
CopyrightMarch2010
60
IMLOG10
Returnsthebase10logarithmofacomplexnumber
61
IMLOG2
Returnsthebase2logarithmofacomplexnumber
62
IMPOWER
Returnsacomplexnumberraisedtoanintegerpower
63
IMPRODUCT
Returnstheproductoffrom2to29complexnumbers
64
IMREAL
Returnstherealcoefficientofacomplexnumber
65
IMSIN
Returnsthesineofacomplexnumber
66
IMSQRT
Returnsthesquarerootofacomplexnumber
67
IMSUB
Returnsthedifferencebetweentwocomplexnumbers
68
IMSUM
Returnsthesumofcomplexnumbers
69
OCT2BIN
Convertsanoctalnumbertobinary
70
OCT2DEC
Convertsanoctalnumbertodecimal
71
OCT2HEX
Convertsanoctalnumbertohexadecimal
FinancialFunctions
Function
Description
72
ACCRINT
Returnstheaccruedinterestforasecuritythatpaysperiodicinterest
73
ACCRINTM
Returnstheaccruedinterestforasecuritythatpaysinterestatmaturity
74
AMORDEGRC
Returnsthedepreciationforeachaccountingperiodbyusingadepreciation
coefficient
75
AMORLINC
Returnsthedepreciationforeachaccountingperiod
76
COUPDAYBS
Returnsthenumberofdaysfromthebeginningofthecouponperiodtothe
settlementdate
77
COUPDAYS
Returnsthenumberofdaysinthecouponperiodthatcontainsthe
settlementdate
78
COUPDAYSNC
Returnsthenumberofdaysfromthesettlementdatetothenextcoupon
date
www.ExcelAdvisor.net
Page23
CopyrightMarch2010
79
COUPNCD
Returnsthenextcoupondateafterthesettlementdate
80
COUPNUM
Returnsthenumberofcouponspayablebetweenthesettlementdateand
maturitydate
81
COUPPCD
Returnsthepreviouscoupondatebeforethesettlementdate
82
CUMIPMT
Returnsthecumulativeinterestpaidbetweentwoperiods
83
CUMPRINC
Returnsthecumulativeprincipalpaidonaloanbetweentwoperiods
84
DB
Returnsthedepreciationofanassetforaspecifiedperiodbyusingthefixed
decliningbalancemethod
85
DDB
Returnsthedepreciationofanassetforaspecifiedperiodbyusingthe
doubledecliningbalancemethodorsomeothermethodthatyouspecify
86
DISC
Returnsthediscountrateforasecurity
87
DOLLARDE
Convertsadollarprice,expressedasafraction,intoadollarprice,expressed
asadecimalnumber
88
DOLLARFR
Convertsadollarprice,expressedasadecimalnumber,intoadollarprice,
expressedasafraction
89
DURATION
Returnstheannualdurationofasecuritywithperiodicinterestpayments
90
EFFECT
Returnstheeffectiveannualinterestrate
91
FV
Returnsthefuturevalueofaninvestment
92
FVSCHEDULE
Returnsthefuturevalueofaninitialprincipalafterapplyingaseriesof
compoundinterestrates
93
INTRATE
Returnstheinterestrateforafullyinvestedsecurity
94
IPMT
Returnstheinterestpaymentforaninvestmentforagivenperiod
95
IRR
Returnstheinternalrateofreturnforaseriesofcashflows
96
ISPMT
Calculatestheinterestpaidduringaspecificperiodofaninvestment
97
MDURATION
ReturnstheMacauleymodifieddurationforasecuritywithanassumedpar
valueof$100
98
MIRR
Returnstheinternalrateofreturnwherepositiveandnegativecashflowsare
financedatdifferentrates
www.ExcelAdvisor.net
Page24
CopyrightMarch2010
99
NOMINAL
Returnstheannualnominalinterestrate
100 NPER
Returnsthenumberofperiodsforaninvestment
101 NPV
Returnsthenetpresentvalueofaninvestmentbasedonaseriesofperiodic
cashflowsandadiscountrate
102 ODDFPRICE
Returnsthepriceper$100facevalueofasecuritywithanoddfirstperiod
103 ODDFYIELD
Returnstheyieldofasecuritywithanoddfirstperiod
104 ODDLPRICE
Returnsthepriceper$100facevalueofasecuritywithanoddlastperiod
105 ODDLYIELD
Returnstheyieldofasecuritywithanoddlastperiod
106 PMT
Returnstheperiodicpaymentforanannuity
107 PPMT
Returnsthepaymentontheprincipalforaninvestmentforagivenperiod
108 PRICE
Returnsthepriceper$100facevalueofasecuritythatpaysperiodicinterest
109 PRICEDISC
Returnsthepriceper$100facevalueofadiscountedsecurity
110 PRICEMAT
Returnsthepriceper$100facevalueofasecuritythatpaysinterestat
maturity
111 PV
Returnsthepresentvalueofaninvestment
112 RATE
Returnstheinterestrateperperiodofanannuity
113 RECEIVED
Returnstheamountreceivedatmaturityforafullyinvestedsecurity
114 SLN
Returnsthestraightlinedepreciationofanassetforoneperiod
115 SYD
Returnsthesumofyears'digitsdepreciationofanassetforaspecified
period
116 TBILLEQ
ReturnsthebondequivalentyieldforaTreasurybill
117 TBILLPRICE
Returnsthepriceper$100facevalueforaTreasurybill
118 TBILLYIELD
ReturnstheyieldforaTreasurybill
119 VDB
Returnsthedepreciationofanassetforaspecifiedorpartialperiodbyusing
adecliningbalancemethod
120 XIRR
Returnstheinternalrateofreturnforascheduleofcashflowsthatisnot
www.ExcelAdvisor.net
Page25
CopyrightMarch2010
necessarilyperiodic
121 XNPV
Returnsthenetpresentvalueforascheduleofcashflowsthatisnot
necessarilyperiodic
122 YIELD
Returnstheyieldonasecuritythatpaysperiodicinterest
123 YIELDDISC
Returnstheannualyieldforadiscountedsecurity;forexample,aTreasurybill
124 YIELDMAT
Returnstheannualyieldofasecuritythatpaysinterestatmaturity
InformationFunctions
Function
Description
125 CELL
Returnsinformationabouttheformatting,location,orcontentsofacell
126 ERROR.TYPE
Returnsanumbercorrespondingtoanerrortype
127 INFO
Returnsinformationaboutthecurrentoperatingenvironment
128 ISBLANK
ReturnsTRUEifthevalueisblank
129 ISERR
ReturnsTRUEifthevalueisanyerrorvalueexcept#N/A
130 ISERROR
ReturnsTRUEifthevalueisanyerrorvalue
131 ISEVEN
ReturnsTRUEifthenumberiseven
132 ISLOGICAL
ReturnsTRUEifthevalueisalogicalvalue
133 ISNA
ReturnsTRUEifthevalueisthe#N/Aerrorvalue
134 ISNONTEXT
ReturnsTRUEifthevalueisnottext
135 ISNUMBER
ReturnsTRUEifthevalueisanumber
136 ISODD
ReturnsTRUEifthenumberisodd
137 ISREF
ReturnsTRUEifthevalueisareference
138 ISTEXT
ReturnsTRUEifthevalueistext
139 N
Returnsavalueconvertedtoanumber
140 NA
Returnstheerrorvalue#N/A
www.ExcelAdvisor.net
Page26
CopyrightMarch2010
141 TYPE
17
LogicalFunctions
Function
Returnsanumberindicatingthedatatypeofavalue
Description
142 AND
ReturnsTRUEifallofitsargumentsareTRUE
143 FALSE
ReturnsthelogicalvalueFALSE
144 IF
Specifiesalogicaltesttoperform
145 NOT
Reversesthelogicofitsargument
146 OR
ReturnsTRUEifanyargumentisTRUE
147 TRUE
ReturnsthelogicalvalueTRUE
LookupandReferenceFunctions
Function
Description
148 ADDRESS
Returnsareferenceastexttoasinglecellinaworksheet
149 AREAS
Returnsthenumberofareasinareference
150 CHOOSE
Choosesavaluefromalistofvalues
151 COLUMN
Returnsthecolumnnumberofareference
152 COLUMNS
Returnsthenumberofcolumnsinareference
153 GETPIVOTDATA
ReturnsdatastoredinaPivotTable
154 HLOOKUP
Looksinthetoprowofanarrayandreturnsthevalueoftheindicatedcell
155 HYPERLINK
Createsashortcutorjumpthatopensadocumentstoredonanetwork
server,anintranet,ortheInternet
156 INDEX
Usesanindextochooseavaluefromareferenceorarray
157 INDIRECT
Returnsareferenceindicatedbyatextvalue
158 LOOKUP
Looksupvaluesinavectororarray
www.ExcelAdvisor.net
Page27
CopyrightMarch2010
159 MATCH
Looksupvaluesinareferenceorarray
160 OFFSET
Returnsareferenceoffsetfromagivenreference
161 ROW
Returnstherownumberofareference
162 ROWS
Returnsthenumberofrowsinareference
163 RTD
RetrievesrealtimedatafromaprogramthatsupportsCOM
automation(Automation:Awaytoworkwithanapplication'sobjectsfrom
anotherapplicationordevelopmenttool.FormerlycalledOLEAutomation,
AutomationisanindustrystandardandafeatureoftheComponentObject
Model(COM).)
164 TRANSPOSE
Returnsthetransposeofanarray
165 VLOOKUP
Looksinthefirstcolumnofanarrayandmovesacrosstherowtoreturnthe
valueofacell
MathandTrigonometryFunctions
Function
Description
166 ABS
Returnstheabsolutevalueofanumber
167 ACOS
Returnsthearccosineofanumber
168 ACOSH
Returnstheinversehyperboliccosineofanumber
169 ASIN
Returnsthearcsineofanumber
170 ASINH
Returnstheinversehyperbolicsineofanumber
171 ATAN
Returnsthearctangentofanumber
172 ATAN2
Returnsthearctangentfromxandycoordinates
173 ATANH
Returnstheinversehyperbolictangentofanumber
174 CEILING
Roundsanumbertothenearestintegerortothenearestmultipleof
significance
175 COMBIN
Returnsthenumberofcombinationsforagivennumberofobjects
176 COS
Returnsthecosineofanumber
www.ExcelAdvisor.net
Page28
CopyrightMarch2010
177 COSH
Returnsthehyperboliccosineofanumber
178 DEGREES
Convertsradianstodegrees
179 EVEN
Roundsanumberuptothenearesteveninteger
180 EXP
Returnseraisedtothepowerofagivennumber
181 FACT
Returnsthefactorialofanumber
182 FACTDOUBLE
Returnsthedoublefactorialofanumber
183 FLOOR
Roundsanumberdown,towardzero
184 GCD
Returnsthegreatestcommondivisor
185 INT
Roundsanumberdowntothenearestinteger
186 LCM
Returnstheleastcommonmultiple
187 LN
Returnsthenaturallogarithmofanumber
188 LOG
Returnsthelogarithmofanumbertoaspecifiedbase
189 LOG10
Returnsthebase10logarithmofanumber
190 MDETERM
Returnsthematrixdeterminantofanarray
191 MINVERSE
Returnsthematrixinverseofanarray
192 MMULT
Returnsthematrixproductoftwoarrays
193 MOD
Returnstheremainderfromdivision
194 MROUND
Returnsanumberroundedtothedesiredmultiple
195 MULTINOMIAL
Returnsthemultinomialofasetofnumbers
196 ODD
Roundsanumberuptothenearestoddinteger
197 PI
Returnsthevalueofpi
198 POWER
Returnstheresultofanumberraisedtoapower
199 PRODUCT
Multipliesitsarguments
200 QUOTIENT
Returnstheintegerportionofadivision
www.ExcelAdvisor.net
Page29
CopyrightMarch2010
201 RADIANS
Convertsdegreestoradians
202 RAND
Returnsarandomnumberbetween0and1
203 RANDBETWEEN
Returnsarandomnumberbetweenthenumbersyouspecify
204 ROMAN
Convertsanarabicnumeraltoroman,astext
205 ROUND
Roundsanumbertoaspecifiednumberofdigits
206 ROUNDDOWN
Roundsanumberdown,towardzero
207 ROUNDUP
Roundsanumberup,awayfromzero
208 SERIESSUM
Returnsthesumofapowerseriesbasedontheformula
209 SIGN
Returnsthesignofanumber
210 SIN
Returnsthesineofthegivenangle
211 SINH
Returnsthehyperbolicsineofanumber
212 SQRT
Returnsapositivesquareroot
213 SQRTPI
Returnsthesquarerootof(number*pi)
214 SUBTOTAL
Returnsasubtotalinalistordatabase
215 SUM
Addsitsarguments
216 SUMIF
Addsthecellsspecifiedbyagivencriteria
217 SUMPRODUCT
Returnsthesumoftheproductsofcorrespondingarraycomponents
218 SUMSQ
Returnsthesumofthesquaresofthearguments
219 SUMX2MY2
Returnsthesumofthedifferenceofsquaresofcorrespondingvaluesintwo
arrays
220 SUMX2PY2
Returnsthesumofthesumofsquaresofcorrespondingvaluesintwoarrays
221 SUMXMY2
Returnsthesumofsquaresofdifferencesofcorrespondingvaluesintwo
arrays
222 TAN
Returnsthetangentofanumber
223 TANH
Returnsthehyperbolictangentofanumber
www.ExcelAdvisor.net
Page30
CopyrightMarch2010
224 TRUNC
Truncatesanumbertoaninteger
StatisticalFunctions
Function
Description
225 AVEDEV
Returnstheaverageoftheabsolutedeviationsofdatapointsfromtheir
mean
226 AVERAGE
Returnstheaverageofitsarguments
227 AVERAGEA
Returnstheaverageofitsarguments,includingnumbers,text,andlogical
values
228 BETADIST
ReturnsthebetacumulativedistributionFunction
229 BETAINV
ReturnstheinverseofthecumulativedistributionFunctionforaspecified
betadistribution
230 BINOMDIST
Returnstheindividualtermbinomialdistributionprobability
231 CHIDIST
Returnstheonetailedprobabilityofthechisquareddistribution
232 CHIINV
Returnstheinverseoftheonetailedprobabilityofthechisquared
distribution
233 CHITEST
Returnsthetestforindependence
234 CONFIDENCE
Returnstheconfidenceintervalforapopulationmean
235 CORREL
Returnsthecorrelationcoefficientbetweentwodatasets
236 COUNT
Countshowmanynumbersareinthelistofarguments
237 COUNTA
Countshowmanyvaluesareinthelistofarguments
238 COUNTBLANK
Countsthenumberofblankcellswithinarange
239 COUNTIF
Countsthenumberofnonblankcellswithinarangethatmeetthegiven
criteria
240 COVAR
Returnscovariance,theaverageoftheproductsofpaireddeviations
241 CRITBINOM
Returnsthesmallestvalueforwhichthecumulativebinomialdistributionis
lessthanorequaltoacriterionvalue
www.ExcelAdvisor.net
Page31
CopyrightMarch2010
242 DEVSQ
Returnsthesumofsquaresofdeviations
243 EXPONDIST
Returnstheexponentialdistribution
244 FDIST
ReturnstheFprobabilitydistribution
245 FINV
ReturnstheinverseoftheFprobabilitydistribution
246 FISHER
ReturnstheFishertransformation
247 FISHERINV
ReturnstheinverseoftheFishertransformation
248 FORECAST
Returnsavaluealongalineartrend
249 FREQUENCY
Returnsafrequencydistributionasaverticalarray
250 FTEST
ReturnstheresultofanFtest
251 GAMMADIST
Returnsthegammadistribution
252 GAMMAINV
Returnstheinverseofthegammacumulativedistribution
253 GAMMALN
ReturnsthenaturallogarithmofthegammaFunction,(x)
254 GEOMEAN
Returnsthegeometricmean
255 GROWTH
Returnsvaluesalonganexponentialtrend
256 HARMEAN
Returnstheharmonicmean
257 HYPGEOMDIST
Returnsthehypergeometricdistribution
258 INTERCEPT
Returnstheinterceptofthelinearregressionline
259 KURT
Returnsthekurtosisofadataset
260 LARGE
Returnsthekthlargestvalueinadataset
261 LINEST
Returnstheparametersofalineartrend
262 LOGEST
Returnstheparametersofanexponentialtrend
263 LOGINV
Returnstheinverseofthelognormaldistribution
264 LOGNORMDIST
Returnsthecumulativelognormaldistribution
265 MAX
Returnsthemaximumvalueinalistofarguments
www.ExcelAdvisor.net
Page32
CopyrightMarch2010
266 MAXA
Returnsthemaximumvalueinalistofarguments,includingnumbers,text,
andlogicalvalues
267 MEDIAN
Returnsthemedianofthegivennumbers
268 MIN
Returnstheminimumvalueinalistofarguments
269 MINA
Returnsthesmallestvalueinalistofarguments,includingnumbers,text,and
logicalvalues
270 MODE
Returnsthemostcommonvalueinadataset
271 NEGBINOMDIST
Returnsthenegativebinomialdistribution
272 NORMDIST
Returnsthenormalcumulativedistribution
273 NORMINV
Returnstheinverseofthenormalcumulativedistribution
274 NORMSDIST
Returnsthestandardnormalcumulativedistribution
275 NORMSINV
Returnstheinverseofthestandardnormalcumulativedistribution
276 PEARSON
ReturnsthePearsonproductmomentcorrelationcoefficient
277 PERCENTILE
Returnsthekthpercentileofvaluesinarange
278 PERCENTRANK
Returnsthepercentagerankofavalueinadataset
279 PERMUT
Returnsthenumberofpermutationsforagivennumberofobjects
280 POISSON
ReturnsthePoissondistribution
281 PROB
Returnstheprobabilitythatvaluesinarangearebetweentwolimits
282 QUARTILE
Returnsthequartileofadataset
283 RANK
Returnstherankofanumberinalistofnumbers
284 RSQ
ReturnsthesquareofthePearsonproductmomentcorrelationcoefficient
285 SKEW
Returnstheskewnessofadistribution
286 SLOPE
Returnstheslopeofthelinearregressionline
287 SMALL
Returnsthekthsmallestvalueinadataset
288 STANDARDIZE
Returnsanormalizedvalue
www.ExcelAdvisor.net
Page33
CopyrightMarch2010
289 STDEV
Estimatesstandarddeviationbasedonasample
290 STDEVA
Estimatesstandarddeviationbasedonasample,includingnumbers,text,and
logicalvalues
291 STDEVP
Calculatesstandarddeviationbasedontheentirepopulation
292 STDEVPA
Calculatesstandarddeviationbasedontheentirepopulation,including
numbers,text,andlogicalvalues
293 STEYX
Returnsthestandarderrorofthepredictedyvalueforeachxinthe
regression
294 TDIST
ReturnstheStudent'stdistribution
295 TINV
ReturnstheinverseoftheStudent'stdistribution
296 TREND
Returnsvaluesalongalineartrend
297 TRIMMEAN
Returnsthemeanoftheinteriorofadataset
298 TTEST
ReturnstheprobabilityassociatedwithaStudent'sttest
299 VAR
Estimatesvariancebasedonasample
300 VARA
Estimatesvariancebasedonasample,includingnumbers,text,andlogical
values
301 VARP
Calculatesvariancebasedontheentirepopulation
302 VARPA
Calculatesvariancebasedontheentirepopulation,includingnumbers,text,
andlogicalvalues
303 WEIBULL
ReturnstheWeibulldistribution
304 ZTEST
Returnstheonetailedprobabilityvalueofaztest
TextFunctions
Function
Description
305 ASC
Changesfullwidth(doublebyte)Englishlettersorkatakanawithina
characterstringtohalfwidth(singlebyte)characters
306 BAHTTEXT
Convertsanumbertotext,usingthe(baht)currencyformat
www.ExcelAdvisor.net
Page34
CopyrightMarch2010
307 CHAR
Returnsthecharacterspecifiedbythecodenumber
308 CLEAN
Removesallnonprintablecharactersfromtext
309 CODE
Returnsanumericcodeforthefirstcharacterinatextstring
310 CONCATENATE
Joinsseveraltextitemsintoonetextitem
311 DOLLAR
Convertsanumbertotext,usingthe$(dollar)currencyformat
312 EXACT
Checkstoseeiftwotextvaluesareidentical
313 FIND,FINDB
Findsonetextvaluewithinanother(casesensitive)
314 FIXED
Formatsanumberastextwithafixednumberofdecimals
315 JIS
Changeshalfwidth(singlebyte)Englishlettersorkatakanawithinacharacter
stringtofullwidth(doublebyte)characters
316 LEFT,LEFTB
Returnstheleftmostcharactersfromatextvalue
317 LEN,LENB
Returnsthenumberofcharactersinatextstring
318 LOWER
Convertstexttolowercase
319 MID,MIDB
Returnsaspecificnumberofcharactersfromatextstringstartingatthe
positionyouspecify
320 PHONETIC
Extractsthephonetic(furigana)charactersfromatextstring
321 PROPER
Capitalizesthefirstletterineachwordofatextvalue
322 REPLACE,
REPLACEB
Replacescharacterswithintext
323 REPT
Repeatstextagivennumberoftimes
324 RIGHT,RIGHTB
Returnstherightmostcharactersfromatextvalue
325 SEARCH,
SEARCHB
Findsonetextvaluewithinanother(notcasesensitive)
326 SUBSTITUTE
Substitutesnewtextforoldtextinatextstring
327 T
Convertsitsargumentstotext
328 TEXT
Formatsanumberandconvertsittotext
www.ExcelAdvisor.net
Page35
CopyrightMarch2010
329 TRIM
Removesspacesfromtext
330 UPPER
Convertstexttouppercase
331 VALUE
Convertsatextargumenttoanumber
ExternalFunctions
Function
Description
332 EUROCONVERT
Convertsanumbertoeuros,convertsanumberfromeurostoaeuro
membercurrency,orconvertsanumberfromoneeuromembercurrencyto
anotherbyusingtheeuroasanintermediary(triangulation)
333 SQL.REQUEST
Connectswithanexternaldatasourceandrunsaqueryfromaworksheet,
thenreturnstheresultasanarraywithouttheneedformacroprogramming
www.ExcelAdvisor.net
Page36
CopyrightMarch2010
Chapter4
The=IFFunction
www.ExcelAdvisor.net
Page37
CopyrightMarch2010
=IF
The IF function is the most powerful of all functions not just in Excel, but in any programming language.
Commonly referred to as Conditional Programming, it is the IF function that enables us to introduce logical
thinking into any program. This function is also referred to as the IfThenElse command, conditional
expressions,orPropositionalLogic.ThefollowingWikisexplainsthisconceptinmoredetail:
http://en.wikipedia.org/wiki/Conditional_(programming).
http://en.wikipedia.org/wiki/Logical_conditional#Conditional_statements
The clever CPA can use the IF Function to build elaborate Excel templates and financial models containing an
almostunlimitedamountofsophisticatedprogramming.Presentedbelowareseveralexamplestohelpyoubetter
understandtheapplicationofthispowerfultool.
SimpleIFTheIFfunctionreturnsonevalueifaconditionyouspecifyevaluatestoTRUE,andanothervalueifthat
conditionevaluatestoFALSE.Presentedbelowisasimpleexample:
SimpleIFwithCalculationPresentedbelowisanexamplethatisalittlemorecomplex:
Simple IF Larger Example Presented below is yet another IF example on a little larger scale this example
showshowonemightapplytheIFfunctiontoevaluatebudgetversusactualcomparisons.
www.ExcelAdvisor.net
Page38
CopyrightMarch2010
SimpleIFwithDropDownInthefollowingexample,theIFfunctionischeckingtoseeiftheyhavesignedupfor
insurance.Iftheyhave,thedeductionamountisentered.
www.ExcelAdvisor.net
Page39
CopyrightMarch2010
SimpleIFwithCalculationThenextIFfunctionexampleisdeterminingeachemployeesearnedvacationdays.If
they have worked for more than a year, they have earned 5 vacationdays plus oneday for each additional full
year.
NestedIFFunctionsInthissample,therearefourpossibilitiesforbonuses.
IFFunctionwithLogicalORArgumentTeamsAandCmeetonTuesday,TeamsBandDmeetonThursday.We
wanttolistthemeetingdaysincolumnD.
More Complex IF FunctionExample The following IF example shows a more complex application in which the
user selects a taxpayer status from a drop down list, which then retrieves the correct tax base, threshold, and
incrementaltaxratestobeusedincalculatingtax.
www.ExcelAdvisor.net
Page40
CopyrightMarch2010
ThisexampleillustrateshowaCPAmightprepareanincomestatementtemplatethatcalculatestheappropriate
amountoftaxesasnetincomeandthetaxpayerstatuschanges.Essentiallythetemplatecalculatesthecorrecttax
givenallfourpossibletaxpayerstatuses,andtheIFstatementsareusedtoselectthecorrectanswersbasedonthe
taxpayerstatusselected.
Keepinmindthatdespitethemanyaccoladesmentionedabove,theIFFunctionisnotalwaysthebestsolution.
Forexample,theVLOOKUPwouldbeabetterandeasierfunctiontousetoextractdatafromalistasshowninthe
nestedIFFunctionafewexamplesabove.ManyExcelFunctionsalsoprovidebuiltinIFThenElsefunctionality.
KeyPointersforUsingtheIFFunction:
1. NestingYoucanembedupto8nestedIFfunctionsinasingleformulainExcel2003,andupto
64IFnestedfunctionsinExcel2007.
2. AND,ORYoucanusetheANDand/orORoperatortoaddmoreconditionstoanIFFunction.
3. Variations of IF Excel offers several variations of the IF function as follows: COUNTIF,
COUNTIFS,SUMIF,SUMIFS.
4. EvaluatinganIFErrorSincetheIFstatementprovidesonlyatrueorfalseresult,thereisno
waytoevaluateanIFFunctiontoERROR.Ifyoureceiveanerror,youwrotetheformulawrong.
5. The Null Set The Double Quotes is the Null Set, or absence of a value. For example, when
testingforaZerobalanceortestingforablankcell,thefollowingIFfunctionswouldapply:
a. =IF(A1=0,ZERO,)
b. =IF(A1=,Blank,)
(ExcelalsoprovidesanISBLANKFunctionthatwouldalsowork.)
www.ExcelAdvisor.net
Page41
CopyrightMarch2010
Chapter5
UsingFunctionsTo
Crunch&CleanData
www.ExcelAdvisor.net
Page42
CopyrightMarch2010
CleaningDataUsingFunctions
CPAsoftenreceiveorretrievedatafrommanysourcesinawidevarietyofformatssuchasTextorCSVformats.
Youdon'talwayshavecontrolovertheformatandtypeofdatathatyouimportfromanexternaldatasource,such
asadatabase,textfile,oraWebpage.Beforeyoucananalyzethedata,youoftenneedtocleanitup.Fortunately,
OfficeExcelhasmanyfeaturestohelpyougetdatainthepreciseformatthatyouwant.Sometimes,thetaskis
straightforwardandthereisaspecificfeaturethatdoesthejobforyou.
Forexample,youcaneasilyuseSpellCheckertocleanupmisspelledwordsincolumnsthatcontaincommentsor
descriptions.Or,ifyouwanttoremoveduplicaterows,youcanquicklydothisbyusingtheRemoveDuplicates
dialogbox.Atothertimes,youmayneedtomanipulateoneormorecolumnsbyusingaformulatoconvertthe
importedvaluesintonewvalues.
For example, if you want to remove trailing spaces, you can create a new column to clean the data by using a
formula,fillingdownthenewcolumn,convertingthatnewcolumn'sformulastovalues,andthenremovingthe
originalcolumn.Excelprovidesmanyfunctionstohelpyoucleanyourdataasfollows:
1.
2.
3.
4.
5.
6.
7.
8.
9.
Import
TexttoColumns
RemoveDuplicates
Find&Replace
SpellCheck
=UPPER
=LOWER
=PROPER
=FIND
www.ExcelAdvisor.net
10. =SEARCH
11. =LEN
12. =SUBSTITUTE
13. =REPLACE
14. =LEFT
15. =MID
16. =RIGHT
17. =VALUE
18. =CONCATENATE
Page43
19. =TEXT
20. =TRIM
21. =CLEAN
22. =FIXED
23. =DOLLAR
24. =CODE
25. Macros
CopyrightMarch2010
1. Importing Data into Excel Of course excel opens up excel files, but what happens
whenyouattempttoopendatathatisnotcontainedinanExcelformat?Theansweris
that Excel automatically imports that data on the fly and displays a Import Wizard to
helpyoucompletetheprocess.TheTextImportWizardexaminesthetextfilethatyou
areimportingandhelpsyouimportthedatathewaythatyouwant.TostarttheText
ImportWizard,ontheDatatab,intheGetExternalDatagroup,clickFromText.Then,in
theImportTextFiledialogbox,doubleclickthetextfilethatyouwanttoimport.The
followingdialogboxwillbedisplayed:
If items in the text file are separated by tabs, colons, semicolons, spaces, or other characters, select
Delimited.Ifalloftheitemsineachcolumnarethesamelength,selectFixedwidth.Instep3,clickthe
Advancedbuttontospecifythatoneormorenumericvaluesmaycontainatrailingminussign.Alsoclick
thedesireddataformatforeachcolumntobeimported.
2. Text to Columns The Text to Columns command located on the Data Ribbon works
exactlythesamewayasdescribedabovetheusersimplylaunchesittoconvertdata
withinanexistingworksheet.
3. Removing Duplicate Rows Duplicate rows are a common problem when you import
data. You can identify and remove duplicate rows by using the Data, Advanced Filter,
UniqueRecordsOnlytoolasshowinthescreenbelow.
4. Find and Replace Text This tool can be used to identify and remove leading string,
suchasalabelfollowedbyacolonandspace,orasuffix,suchasaparentheticphraseat
the end of the string that is obsolete or unnecessary. You can do this by finding
instancesofthattextandthenreplacingitwithnotextorothertext.
NoteworthyFindandReplacePoints:
1. Youcansearchandreplaceforanentireworksheet,ortheentireworkbook.
2. Youcanfindandreplaceformatswithnewformats.
3. Thereisacellchooseroptionthatmakesiteasiertofindandreplaceformats.
Page45
4. Ifyouhighlightarangeofcells,thensearchandreplaceonlysearchesandreplaces
withinthatrangeofcells.
5. Youcanreplaceallatonceoroneatatime.
6. Youcouldalsofindandreplacereferencesinaformula.
5. SpellCheckYoucanuseaspellcheckertonotonlyfindmisspelledwords,buttofindvalues
thatarenotusedconsistently,suchasproductorcompanynames,byaddingthosevaluestoa
customdictionary.Thespellcheckfunctionalsochecksyourgrammaraswell.
Changing The Case Of Text You can use one or more of the three Case functions to convert text to
lowercaseletters,suchasemailaddresses,uppercaseletters,suchasproductcodes,orpropercase,such
asnamesorbooktitles.
6. =UPPERConvertstexttouppercaseletters.
7. =LOWERConvertsalluppercaselettersinatextstringtolowercaseletters.
8. =PROPERCapitalizesthefirstletterinatextstringandanyotherlettersintextthatfollowany
characterotherthanaletter.Convertsallotherletterstolowercaseletters.
Page46
MergingAndSplittingColumnsAcommontaskafterimportingdatafromanexternaldatasourceisto
eithermergetwoormorecolumnsintoone,orsplitonecolumnintotwoormorecolumns.Forexample,
youmaywanttosplitacolumnthatcontainsafullnameintoafirstandlastname.Or,youmaywantto
splitacolumnthatcontainsanaddressfieldintoseparatestreet,city,region,andpostalcodecolumns.
Thereversemayalsobetrue.Presentedbelowarefunctionsthattohelpyouaccomplishthesetasks:
9. =FINDUseReturnsthestartingpositionofacharacter,stringofcharactersorwordwitha
cell.Findiscasesensitive.
10. =SEARCHReturnsthestartingpositionofacharacter,stringofcharactersorwordwithacell.
Searchisnotcasesensitive.
11. =LENDisplaysthelengthornumberofcharactersinacell.
12. =SUBSTITUTEReplacesacharacterorcharacterswithacharacterorcharactersthatyou
specify.
13. =REPLACEReplacesacharacterorcharacterswithacharacterorcharactersthatyouspecify.
14. =LEFTExtractsthespecifiednumberofcharactersfromacell,startingfromtheleft.
Page47
15. =MIDExtractsthespecifiednumberofcharactersfromacell,startingfromsomewhereinthe
middleofthecell.
16. =RIGHTExtractsthespecifiednumberofcharactersfromacell,startingfromtheright.
17. =ValueConvertstexttovaluessothedatacanbeadded,subtracted,multiplied,dividedor
referencedinafunction.
18. =CONCATENATEJoinstwoormoretextstringsintoonetextstring.
Variationsofthesefunctionsthatareusedwhenworkingwithforeignlanguages:
)
=FINDBUsethiswhenworkingwithforeigncharacterslikethese( ","
=SEARCHBUsethiswhenworkingwithforeigncharacterslikethese( ","
)
=REPLACEBUsethiswhenworkingwithforeigncharacterslikethese( ","
)
)
=LEFTBUsethiswhenworkingwithforeigncharacterslikethese( ","
=RIGHTBUsethiswhenworkingwithforeigncharacterslikethese( ","
)
=LENBUsethiswhenworkingwithforeigncharacterslikethese( ","
)
=MIDBUsethiswhenworkingwithforeigncharacterslikethese( ","
)
Cleaning Text (Removing Spaces And Nonprinting Characters From Text) Sometimes text values
contain leading, trailing, or multiple embedded space characters (Unicode character set values 32 and
160),ornonprintingcharacters(Unicodecharactersetvalues0to31,127,129,141,143,144,and157).
Thesecharacterscansometimescauseunexpectedresultswhenyousort,filter,orsearch.Forexample,in
the external data source, users may make typographical errors by inadvertently adding extra space
characters, or imported text data from external sources may contain nonprinting characters that are
Page48
embedded in the text. Because these characters are not easily noticed, the unexpected results may be
difficulttounderstand.Followingisalistoffunctionsyoucanusetoremovetheseunwantedcharacters:
19. =TEXTConvertsavaluetotextinaspecificnumberformat.
20. =TRIMRemovesthe7bitASCIIspacecharacter(value32)fromtext.
21. =CLEANRemovesthefirst32nonprintingcharactersinthe7bitASCIIcode(values0
through31)fromtext.
22. =FIXEDRoundsanumbertothespecifiednumberofdecimals,formatsthenumberin
decimalformatbyusingaperiodandcommas,andreturnstheresult.
23. =DOLLARConvertsanumbertotextformatandappliesacurrencysymbol.
24. =CODEReturnsanumericcodeforthefirstcharacterinatextstring.
Page49
Fixing Dates and Times There are many different date formats, and these varied formats may be
confusedwithnumberedpartcodesorotherstringsthatcontainslashmarksorhyphens,datesandtimes
often need to be converted and reformatted. Presented below is a list of functions that help you
accomplishthistask.
25. =DATE Returns the sequential serial number that represents a particular date. If the cell
formatwasGeneralbeforethefunctionwasentered,theresultisformattedasadate.
26. =DATEVALUEConvertsadaterepresentedbytexttoaserialnumber.
27. =TIMEReturnsthedecimalnumberforaparticulartime.IfthecellformatwasGeneral
beforethefunctionwasentered,theresultisformattedasadate.
28. =TIMEVALUE Returns the decimal number of the time represented by a text string.
Thedecimalnumberisavaluerangingfrom0(zero)to0.99999999,representingthe
timesfrom0:00:00(12:00:00AM)to23:59:59(11:59:59P.M.).
Transforming And Rearranging Columns And Rows Most of the analysis and formatting features in
OfficeExcelassumethatthedataexistsinasingle,flattwodimensionaltable.Sometimesyoumaywant
to make the rows become columns, and the columns become rows. At other times, data is not even
structuredinatabularformat,andyouneedawaytotransformthedatafromanontabulartoatabular
format.Thefollowingfunctioncanhelpyouachievethisgoal:
29. =TRANSPOSEReturnsaverticalrangeofcellsasahorizontalrange,orviceversa.
Page50
30. DataFillInTrickAclevertrickforfillinginmissingdatacanbeaccomplishedusingtheGOTO,
Special, Blanks command. Here is how it works. This trick works well when you have a large
volumeofdatabutdescriptionsarenotprovidedforeveryrow,asshownintheexamplebelow:
Startbyenteringasimpleformulareferencingthedatalabelintheabovecell,justlikethis:
Page51
a.
b.
c.
d.
e.
f.
g.
Nextcopythatformula...
HighlighttheentirerangecontainingdatalabelsincolumnsAandB.columns...
PresstheF5keytolaunchtheGoTodialogbox...
SelecttheOptionsBox...
ClickontheBlanksradiobutton...
PressEnter...
Paste.
Thisactionwillcausealldatalabelstorepeatintheemptycellsbeneath.Next:
h. CopycolumnsA&B...
i. PasteSpecialasvaluestoconverttheformulastotextbaseddatalabels...
j. Youarenowreadytosort,filter,subtotalandpivotyourdata.
FetchingDataOccasionally,databaseadministratorsuseOfficeExceltofindandcorrectmatchingerrors
whentwoormoretablesarejoined.Thismightinvolvereconcilingtwotablesfromdifferentworksheets,
forexample,toseeallrecordsinbothtablesortocomparetablesandfindrowsthatdon'tmatch.
31. =VLOOKUPSearchesforavalueinthefirstcolumnofatablearrayandreturnsavalue
in the same row from another column in the table array. For example, consider the
examplebelowwhichusesa=VLOOKUPfunctiontocalculatetheappropriateamount
oftaxduebasedontheIRSrateschedule.
Page52
AstheIncomestatementshownintheshadedareaisupdated,theresultingtaxable
income amount is referenced in Cell F13. Next, 3 VLOOKUP functions pull the
appropriaterate,baseandthresholdinformationfromtheratescheduletobeusedin
calculating income tax. Once calculated, the resulting tax is referenced back to the
incomestatementforthepurposesofcomputingNetincomeAftertaxes.
KeypointstoConsiderwhenUsingVLOOKUP:
a. If you are looking up based on text, the first column containing lookup
valuesmustbesortedalphabeticallyindescendingorderelseitwillnot
workproperly.
b. If you are looking up based on text, you must have an exact match
betweenthelookupvalueandthetablearrayvalue.
c. Ifyouarelookingupbasedonvalues,thefirstcolumncontaininglookup
valuesmustbesortednumericallyindescendingorderelseitwillnot
workproperly.
d. Ifyouarelookingupbasedonvalues,thenExcelwillchoosetheclosest
valuewithoutgoingover.Forexample,ifthelookupvalueis198,000and
thetablearraycontainsvaluesof100,000and200,000,thenexcelwill
choose100,000because200,000goesoverorexceeds198,000.(Itmight
be helpful to think back to the old Bob barker game show the Price is
Right.)
Page53
33. =INDEXReturnsavalueorthereferencetoavaluefromwithinatableorrange.There
aretwoformsoftheINDEXfunction:thearrayformandthereferenceform.
34. =MATCHReturnstherelativepositionofaniteminanarraythatmatchesaspecified
valueinaspecifiedorder.UseMATCHinsteadof oneoftheLOOKUP functionswhen
youneedthepositionofaniteminarangeinsteadoftheitemitself.
35. =OFFSET Returns a reference to a range that is a specified number of rows and
columnsfromacellorrangeofcells.Thereferencethatisreturnedcanbeasinglecell
orarangeofcells.Youcanspecifythenumberofrowsandthenumberofcolumnsto
bereturned.
36. Data Cleaning with Macros To periodically clean the same data source, consider
recording a macro or writing code to automate the entire process. There are also a
number of external addins written by thirdparty vendors, listed in the Thirdparty
providerssection,thatyoucanconsiderusingifyoudon'thavethetimeorresourcesto
automatetheprocessonyourown.
Page54
38. InformationalFunctions
CELL(info_type,reference) - Info_type is a text value that specifies what type of cell
information you want. The following list shows the possible values of info_type and the
corresponding results.
Info_type
Returns
"address"
Referenceofthefirstcellinreference,astext.
"col"
Columnnumberofthecellinreference.
"color"
1ifthecellisformattedincolorfornegativevalues;otherwisereturns0(zero).
"contents"
Valueoftheupperleftcellinreference;notaformula.
"filename"
Filename(includingfullpath)ofthefilethatcontainsreference,astext.Returnsempty
text("")iftheworksheetthatcontainsreferencehasnotyetbeensaved.
"format"
Textvaluecorrespondingtothenumberformatofthecell.Thetextvaluesforthevarious
formatsareshowninthefollowingtable.Returns""attheendofthetextvalueifthe
cellisformattedincolorfornegativevalues.Returns"()"attheendofthetextvalueif
thecellisformattedwithparenthesesforpositiveorallvalues.
"parentheses" 1ifthecellisformattedwithparenthesesforpositiveorallvalues;otherwisereturns0.
"prefix"
Textvaluecorrespondingtothe"labelprefix"ofthecell.Returnssinglequotationmark
(')ifthecellcontainsleftalignedtext,doublequotationmark(")ifthecellcontainsright
alignedtext,caret(^)ifthecellcontainscenteredtext,backslash(\)ifthecellcontains
fillalignedtext,andemptytext("")ifthecellcontainsanythingelse.
"protect"
0ifthecellisnotlocked,and1ifthecellislocked.
"row"
Rownumberofthecellinreference.
"type"
Textvaluecorrespondingtothetypeofdatainthecell.Returns"b"forblankifthecellis
empty, "l" for label if the cell contains a text constant, and "v" for value if the cell
containsanythingelse.
Page55
"width"
Columnwidthofthecellroundedofftoaninteger.Eachunitofcolumnwidthisequalto
thewidthofonecharacterinthedefaultfontsize.
Reference the cell that you want information about. If omitted, information specified in
info_type is returned for the last cell that was changed. The following list describes the
text values CELL returns when info_type is "format", and reference is a cell formatted
with a built-in number format.
IftheMicrosoftExcelformatis
CELLreturns
General
"G"
"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"
mmmyy
"D3"
mm/dd
"D5"
h:mmAM/PM
"D7"
h:mm:ssAM/PM
"D6"
h:mm
"D9"
h:mm:ss
"D8"
Iftheinfo_typeargumentintheCELLformulais"format",andifthecellisformattedlaterwithacustom
format,thenyoumustrecalculatetheworksheettoupdatetheCELLformula.
Page56
ThirdPartySolutionsIncaseExcelsbuiltinfunctionsarenotsufficienttomeetyourneeds,followingis
apartiallistofthirdpartyprovidersthathaveproductsthatareusedtocleandatainavarietyofways.
Provider
Product
AddinExpressLtd.
AdvancedFind&Replace,MergeCellsWizard
AddIns.com
DuplicateFinder
AddinTools
AddinToolsAssist
CDX
ZipStream
Click2Convert
ConvertsPDFtoExcelformats
DigDB
AddinsforExcel
JKPApplicationDevelopment
FlexfindforExcel
JWalk&Associates,Inc.
PowerUtilityPakVersion7
OfficeAssistanceLLC
SimilarDataFinderforExcel
PATools
PAToolsAdvancedFindReplace
PDF2XL
ConvertsPDFfilestoExcelFormats
SpinnakerDBtoolsforExcel
SpinnakerSoftwareSolutions
Vonnix
ExcelPowerExpander4.6
WinPure
ListCleanerLite
ListCleanerPro
CleanandMatch2007
Page57
Chapter6
DataCommands
Page58
TheDataMenuPerhapsthepartsofExcelthatareofmostvaluetoCPAs,butleastusedbyCPAsare
theDatacommandsfoundundertheDatamenuinExcel2003andearlier,andonthedataRibboninExcel
2007. These commands are shown below, and we will concentrate the next hour to studying these
commands.
DataSort TheSorttooldoesexactlywhatitimpliesitsortsanddata.Keysortingpointsareas
follows:
1. Contiguous Data The A to Z sorting tool can sort large matrix of data
automatically as long as the data is contiguous. In other words, your data
shouldcontainnoblankcolumns,noblankrows,andthecolumnsmustallbe
labeled. Only then will Excel always correctly select the entire matrix for
sorting.
2. AtoZButtonSimplyplacethecursorinthedesiredcolumnforsorted,and
presstheAtoZorZtoAbuttonasthecasemaybe.Excelwillautomatically
sortallcontinuouscolumnsthathaveheadingsandallcontiguousrowsfrom
the top row under the heading labels down to the last row in the selected
column that contains data. (Note If you accidently select 2 cells instead of
justone,yourresultswillnotbecorrect.)
Page59
3. Sortby64ColumnsTheSorttoolisdramaticallyenhancedinExcel2007as
it now provides the ability to sort by up to 64 columns, instead of just 3
columns. Presented below is a dialog box which shows this expanded
functionality.
4. SortLefttoRightExcelhasalwaysprovidedtheabilitytosortlefttoright.
Todoso,selecttheoptionsboxintheSortDialogboxandclickthecheckbox
labeledSortlefttoRightasshownbelow.
5. SortbyColorExcel2007nowprovidestheabilitytosortbyfontcolororby
cellcolor,orboth.Thisishandyinmanyways.SometimesCPAsusecolorto
tagormarkcertaincellsandlaterfinditusefultobeabletosortbythose
markings.InothersituationsCPAsuseconditionalformattingtoapplycolorto
cellsusingawidevarietyofrules.ThereafterExcelcansortthedatabasedon
theresultingcolors.Thesortbycoloroptionsareshownbelow.
Page60
Tobeaccurate,itwaspossibletosortbycolorinExcel2003.Toaccomplish
this task, you needed to use the =CELL function in order to identify
informationaboutagivencellsuchasthecellcolororfontcolor.Thereafter,
the results of that function could be used to sort rows which effectively
meansthatyoucansortbycolorinExcel2003butittakesabitmoreeffort.
6. SortByCustomListAnothersortingcapabilityinExcelistheabilitytosort
by Custom List. For example, assume a CPA firm has ten partners, and the
Managing partner prefers to be shown at the top of the list, and the
remainingPartnersbasedonseniority.Inthiscase,youcouldcreateaCustom
List in the excel Options dialog box listing the partners in the desiredorder,
andthensortfuturereportsbasedonthatorder.
FilteringDataUsingAutoFiltertofilterdataallowsyoutoviewasubsetofyourdatainarange
ofcellsortable.Onceyouhavefilteredthedata,youcanapplyadditionalfiltersto furtherrefineyour
dataview.Whenyouaredone,youcanclearafiltertoonceagainredisplayallofthedata.Tousethis
tool,startwithanylistofdataandturnontheAutoFiltertool.Thenpositionyourcursorinthecolumn
youwanttofilterandusethedropdownarrowstoapplyyourfiltersasshowninthescreenbelow.
Page61
Once the filters are applied, you will see a subset your data. For example, the screen presented below
showsfiltereddataforonlyMaconandSavannahproperties.
Asfiltersareapplied,asmallfunnelappearsinthedropdownarrowbuttontoindicatethatafilterhas
beenapplied.Youcanapplyfiltersformultiplecolumnssimultaneously.
Page62
KeyPointsConcerningTheAutoFilterCommand:
1. Contiguous Data The AutoFilter tools works best when you are working with
data that is contiguous. In other words, your data should contain no blank
columns,noblankrows,andthecolumnsmustallbelabeled.
2. FilterbyMultipleColumnsYoucanfilterbymorethanonecolumn.
3. Removing Filters In Excel 2003 and earlier, a faster way to remove multiple
filtersistoturnofffilteringandthenturnfilteringbackon.InExcel2007youcan
simpleclicktheClearbuttonintheSortandFilterGroupasshownbelow.
4. Filters are Additive Each additional filter is based on the current filter and
furtherreducesthesubsetofdata.
5. Three Types of Filters You can filter based on list values, by formats, or by
criteria.Eachofthesefiltertypesismutuallyexclusiveforeachrangeofcellsor
columntable.Forexample,youcanfilterbycellcolororbyalistofnumbers,but
notbyboth;youcanfilterbyiconorbyacustomfilter,butnotbyboth.
7. FilterAppliedAFilterbutton meansthatafilterisapplied.
Page63
8. FilterSpanningThecommandsunder
theAllDatesinthePeriodmenu,such
as January or Quarter 2, filter by the
period no matter what the year. This
canbeuseful,forexample,tocompare
salesbyaperiodacrossseveralyears.
11. Filtering By Days of Week If you want to filter by days of the week, simply
formatthecellstoshowthedayoftheweek.
12. Top&BottomFilteringOntheDatatab,in
theSort&Filtergroup,clickFilter.Pointto
Number Filters and then select Top 10. To
filter by number, click Items. To filter by
percentage, click Percent. Note Top and
bottom values are based on the original
range of cells or table column and not the
filteredsubsetofdata.
are based on the original range of cells or table column and not the filtered
subsetofdata.
14. FilteringOutBlanksTofilterforblanks,intheAutoFiltermenuatthetopofthe
listofvalues,clear(SelectAll),andthenatthebottomofthelistofvalues,select
(Blanks).
15. Filtering By Color Select Filter by Color, and then depending on the type of
format,selectFilterbyCellColor,FilterbyFontColor,orFilterbyCellIcon.
16. Filter by Selection To filter by text, number, or date or time, click Filter by
SelectedCell'sValueandthen:Tofilterbycellcolor,clickFilterbySelectedCell's
Color.Tofilterbyfontcolor,clickFilterbySelectedCell'sFontColor.Tofilterby
icon,clickFilterbySelectedCell'sIcon.
17. Refreshing Filters To reapply a filter after the data changes, click a cell in the
rangeortable,andthenontheDatatab,intheSort&Filtergroup,clickReapply.
Data FormExcels2003DataFormtoolmakesExcellookmoreandbehavemore
likeadatabase,suchasMicrosoftAccess.(TheFormbuttonhasnotbeenincludedon
theOfficeFluentuserinterfaceRibbon,butyoucanstilluseitinOfficeExcel2007by
addingtheFormbuttontotheQuickAccessToolbar.)
A data form provides a convenient means to enter or display one complete row of
informationinarangeortablewithoutscrollinghorizontally.Youmayfindthatusinga
data formcan make data entryeasier than moving from column to column whenyou
Page65
havemorecolumnsofdatathancanbeviewedonthescreen.Useadataformwhena
simple form of text boxes that list the column headings as labels is sufficient and you
don'tneedsophisticatedorcustomformfeatures,suchasalistboxorspinbutton.
Key Points using data Form:
1. You cannot print a data form.
2. Because a data form is a modal dialog box, you cannot use either the
Excel Print command or Print button until you close the data form.
3. You might consider using the Windows Print Screen key to make an
image of the form, and then paste it into Microsoft Word for printing.
Data Subtotals
Page66
KeypointstoConsiderWhenUsingSubtotalingareasfollows:
1. ContiguousDataTheSubtotaltoolsworksbestwhenyouareworkingwithdata
thatiscontiguous.Inotherwords,yourdatashouldcontainnoblankcolumns,no
blankrows,andthecolumnsmustallbelabeled.
2. SortBeforeYourSubtotalYoumustsortthedatabythecolumnyouwishto
Subtotalby,elseyouwillreceiveerroneousresults.
4. Subtotalsin2007TablesExcel2007deploysSubtotalingalittledifferentlyin
that the Subtotal tool appears at the bottom of each column in each table, as
showninthescreenbelow.
5. AutomaticOutliningSubtotalingautomaticallyinsertsOutlines,whichisreally
cool.Youcanthencondenseandexpandthedataintotalandbysubtotal.Some
CPAsalsoliketocopyandpastethecondensedsubtotalinformationtoanother
location but find that this process copies and pastes all of the data. There are
Page67
twowaystoachieveacleancopyandpastewithoutgrabbingallthehiddendata
asfollows:
a. CTRL key Hold the Control Key down while you individually click on each
subtotalrow.Thiswillenableyoutocopyandpastejustthesubtotaldata.This
approachcanbeproblematicbecauseifyoumisclick,youhavetostartover.
b. SelectVisibleCellsAbetterapproachistousetheSelectVisibleCellstool.This
toolwillselectonthedatayoucansee,afterwhichthecopyandpasteroutine
will yield the desired results. This option is better because it is faster and less
errorprone.
DataValidation
DataValidationcanbeusedtolimitthedatathatcanbeenteredintoacell.Forexample,youmightwant
theusertoenteronlyvaluesbetween1%and99%.Youmightalsousethistooltoenabledatainputtoa
dropdownlist.Thishastwoadvantagesinthatitcanbefasterandmoreaccurate.Startwiththedialog
boxbelowtocreateyourdropdownlistfunctionality.
Aftermakingallthenecessaryselectionsinthevalidationlistdialogbox,yourworksheetwillbehaveas
shownbelow.
Page68
Youcanalsoprovidemessagestodefinewhatinputyouexpectforthecell,andinstructionstohelpusers
correct any errors. For example, in a marketing workbook, you can set up a cell to allow only account
numbersthatareexactlythreecharacterslong.Whenusersselectthecell,youcanshowthemamessage
suchasthisone:
Ifusersignorethismessageandtypeinvaliddatainthecell,suchasatwodigitorfivedigitnumber,you
can show them an actual error message. In a more advanced scenario, you might use data validation to
calculate the maximum allowed value in a cell based on a value elsewhere in the workbook. In the
following example, the user has typed $4,000 in cell E7, which exceeds the maximum limit specified for
commissionsandbonuses.
Page69
If the payroll budget were to increase or decrease, the allowed maximum in E7 would automatically
increaseordecreasewithit.
PivotTables
ThePivotTablereporttoolprovidesaninteractivewaytosummarizelargeamountsofdata.Useshould
usethePivotTabletoolstocrunchandanalyzenumericaldataPivotTablereportsareparticularlyusefulin
thefollowingsituations:
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,PivotTablespresentmultidimensionaldataviewstotheuserthisprocessisoftenreferredto
asmodeling,datacubeanalysis,orOLAPdatacubes.TorearrangethePivotTabledata,justdrag
anddropcolumnandrowheadingstomovedataaround.PivotTablesareagreatdataanalysistoolfor
management.
IfyouhaveneverusedaPivotTablebefore,initiallytheconceptcanbedifficulttograsp.
ThebestwaytounderstandaPivotTableistocreateablankPivotTableandthendrag
Page70
and drop field names onto that blank table. This way you will see the resulting pivot
tablemagicallyappearanditwillhelpyoubetterunderstandtheimportantrelationship
betweenthepivotpalletandthefieldnamelist.
LetscreateasimplePivotTable.StartwithanExcelworksheetdatathatcontainsseveral
columnsofdatathedatamustincludecolumnandrowheadingsandithelpsifthedata
is contiguous. Place your cursor anywhere in the data and select PivotTable from the
DatamenuinExcel2003andclickFinish;orfromtheinsertRibboninExcel2007.This
process is shown below: Lets start with a page of data summarizing the results of tax
season as all of the time sheet entries have been entered onto a single worksheet as
shownbelow.
PlaceyourcursoranywhereinthedataandselectPivotTablefromtheInsertRibbonasshownbelow:
Page71
For learning purposes lets right mouse click on the pivot table and select PivotTable Options, Display,
ClassicPivotTableLayout.Yourscreenwillnowappearasfollows:
IlikeforCPAstolearnhowtousePivotTablesinthisviewbecauseitvisuallyhelpsthemunderstandtheall
importantrelationshipbettertheblankpivotpaletteandthePivotTablefieldList,bothelementsofwhich
areshowninthescreenabove.
Toproceed,simplydraganddropfieldnamesshownontherightontotheblankPivotpaletteshownon
theleft.Witheachdrop,yourreportgrowslarger.Asanalternativeyoucouldusethecheckboxesnextto
fieldnamesthisfunctionalityisnewinExcel2007.AfteraddedsomedatatoyourblankPivotPalette,
yourdatawilllooksomethinglikethis:
Page72
NextformatandfilterthePivotReport.Veryquicklyyourreportcomestogetherasshownbelow.Notice
thefilterbuttonhasbeenappliedandaPivottablestylehasalsobeenappliedforappearance.
Doubleclickingonanynumberinapivotreportwillautomaticallyproduceanewworksheetcompletewith
allsupportingdetailthatcomprisesthesummarynumber.
ThereareamultitudeofPivotTableoptionsthatcanbeappliedtoaltertheappearanceorbehaviorofyour
Pivottable.
Page73
KeyPointsConcerningPivotTablesareasFollows:
a. YoucancreateasmanyPivotReportsasyouwantfromyourinitialrawdatapage.Your
rawdataremainsunchangedasnewPivottablesarecreated.
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.
j. PivotTablescanbeformattedusingPivotTableStyles,asshownbelow.
Page74
k. Subtotalsandgrandtotalscanbedisplayedorsuppressedattheusersdesire.
l. PivotTableDatacanbeshownasnumbersorpercentagesattheusersdesire.
m. PivotTablecannotonlybesummed,itcanbeaveraged,minimized,maximized,counted,
etc.
n. Blankrowscanbedisplayedorsuppressedattheusersdesire.
o. A new feature called Compact Form organized multiple column labels into a neatly
organizedoutlinewhichiseasiertoread.
p. PivotTablescanquerydatadirectlyfromanyODBCcompliantdatabase.ThePivotTable
tool for accomplishing this task is not included in the ribbon you will find it by
CustomizingtheQuickAccessToolBarandsearchingtheCommandsNotShowninthe
RibbontabtofindthePivotTableandPivotChartWizardOption.
q. Many accounting systems can push data out of the accounting system into an Excel
PivotTableformatthisiscommonlyreferredtoasanOLAPDataCube.OLAPdataCube
isjustafancywordforPivotTableandthereisnodifference.
r. PivotTablescanautomaticallycombinedatafrommultipledatasources.ThePivotTable
tool for accomplishing this task is not included in the ribbon you will find it by
CustomizingtheQuickAccessToolBarandsearchingtheCommandsNotShowninthe
RibbontabtofindthePivotTableandPivotChartWizardOption.
Page75
s. ExcelalsoprovidesaPivotChartfunctionwhichworkssimilarlytoPivotTables.Presented
belowisanexamplePivotChart.
Excel2003PivotTablesworkverysimilarlyasshownbelow.ExcelcreatesablankPivotTable,andtheuser
mustdraganddropthevariousfieldsfromthePivotTableFieldListontotheappropriatecolumn,row,or
data section. As you drag and drop these items, the resulting report is displayed on the fly. Here is the
blankPivotPaletteview.
Page76
NowdraganddropfieldnamesfromthePivotTablefieldlistontothePivotpallet.This
actionwillautomaticallycreatePivotTablereportsandtheywillchangeeachtimeyou
dropadditionalfieldnames,ormovefieldnamesaround.Presentedbelowarebutafew
examples of hundreds of possible reports that could be viewed with this data through
thePivotTableformat.
This report shown above shows the total resulting sales for each marketing campaign for each of the 4
monthsmarketingcampaignswereconducted.
Page77
In this screen we see the same information is shown as a percentage of the total. A few observations
includethe fact that overall Radio Spots are the most profitable type of campaign, but only in April and
July.InJanuaryandOctober,localadsanddirectmail,respectively,producebetterresults.Further,April
campaignshadthebestresponseoverall.
Furtheranalysisinthescreenabovetellsusthatourresultsvarywidelyfromonecitytothenext.InNew
York,couponswereleasteffective,butcouponsweremosteffectiveinColumbus.Pivotchartsbasedon
PivotTabledatacanbemodifiedbypivotingand/ornarrowingthedata.Theycanalsobepublishedonthe
Internet(oronanIntranet)asinteractiveWebpages.Thisallowsuserstoplaywiththedata.Thechart
belowprovidesavisuallookatthedatashownabove.
Page78
Filtering Pivot Tables If you take a close look at your resulting pivot tables, you will
noticethatExcelautomaticallyinsertsafilterbuttononeachfieldlistasshownbythe
dropdownarrowsinthescreenbelow:
Thisdropdownfilterlistmakesiteasytorefineyourreporttoincludejustthedatayouwant.
DrillingPivotTablesAnothernicefeatureinpivottablesisthattheyareautomatically
drillable. Simply double click on any number in a pivot report top have Excel
automaticallyinsertanewsheetandproducethedetailedreportunderlyingthenumber
youclickedon.Anexampleofthisisshownbelow:
Page79
PivotTableOptionsByrightmouseclickingonyourpivottableyouwillrevealseveraloptionsettings
boxesasshownbelow.Forexample,theseoptionsboxescontrolthetypesofsubtotalsproducedinyour
pivotreports.Excelalsooffersapivottableoptionsboxaswellasalayoutwizardthatmakesproducing
pivottablesalittleeasier.
Page80
DataTable(WhatifAnalysis)
Data tables are part of a suite of commands that are called whatif analysis tools. When you use data
tables,youaredoingwhatifanalysis.Whatifanalysisistheprocessofchangingthevaluesincellstosee
howthosechangeswillaffecttheoutcomeofformulasontheworksheet.Forexample,youcanuseadata
table to vary the interest rate and term length that are used in a loan to determine possible monthly
paymentamounts.
ThreecategoriesofWhatifAnalysisToolsTherearethreekindsofwhatifanalysistoolsinExcel:
1. DataTables
2. GoalSeek
3. Scenarios
A data table cannot accommodate more than two variables. If you want to analyze more than two
variables,youshouldinsteadusescenarios.Althoughitislimitedtoonlyoneortwovariables(oneforthe
rowinputcellandoneforthecolumninputcell),adatatablecanincludeasmanydifferentvariablevalues
asyouwant.Ascenariocanhaveamaximumof32differentvalues,butyoucancreateasmanyscenarios
asyouwant.
Page81
The next step is to create a TwoWay Data Table displaying the resulting payment amount given a
varietyoflengthsoftheloan.Thisprocessisstartedbycreatingalistofthealternativeloanamounts,as
shownbelowinB8,B9,B10,etc.CellC7mustreferencetheresultsyouwanttobedisplayedinthetable.
ThenextstepistohighlightthedatatablerangeandusetheDataTablecommandundertheDatamenu
(asshownbelow)togeneratethedesiredtable.
Thisprocesswillgeneratethefollowingtable:
Page82
Thistabletellsusthatthesameloanamountwillrequireamonthlypaymentof$3,331topaytheloanoff
injust10years,andamonthlypaymentof$5,800torepaytheloaninjust5years.
Thenextstepinthisexerciseistogeneratealinechartbasedonthedatatablewejustcreated.Thisline
chartwillprovidesomeinterestingobservationsregardingthebenefitsanddetrimentsofpayingoffloans
overlongerperiods.
Theresultingchartisshownasfollows:
Page83
Based on this, no one should ever obtain a fair market loan for more than 15 years, the reduction in
paymentssimplyarentworththeadditionallengthoftheloan.Thissamebasicbehaviorisseenwhether
the interest rate is 1% or 100%. The only time you might be justified in obtaining a loan loner than 15
yearsmightbewhenyouareextendedafavorableinterestthisbetterthanafairmarketinterestrate.
Goal Seek
Ifyouknowtheresultthatyouwantfromaformula,butarenotsurewhatinputvaluetheformulaneeds
togetthatresult,usetheGoalSeekfeature.Forexample,supposethatyouneedtoborrowsomemoney.
Youknowhowmuchmoneyyouwant,howlongyouwanttotaketopayofftheloan,andhowmuchyou
canaffordtopayeachmonth.YoucanuseGoalSeektodeterminewhatinterestrateyouwillneedto
secureinordertomeetyourloangoal.GoalSeekworksonlywithonevariableinputvalue.Ifyouwantto
acceptmorethanoneinputvalue;forexample,boththeloanamountandthemonthlypaymentamount
foraloan,youusetheSolveraddindiscussedattheendofthismanual.
Scenarios
Scenario Manager allows you to create and save multiple what if scenarios (such as best case, most
likely,andworstcasesscenarios).Youcanalsocreateasummarytableofthescenarioresultsinseconds.
Itisparticularlyusefulforworksheetssuchasbudgetsinwhichusershaveoftensavedmultiplecopiesof
Page84
thesameworksheettoaccomplishthesameobjective.Anexampleisshownbelow.Inthisexample,atire
companyhaspreparedarevenuebudgetforthecomingyear,andhascreatedthreealternativescenarios
togeneratetherevenuesthatwillresultgivenavarietyofmarkupassumptionsinthiscase100%,110%
and120%markups.
PressingthesummarybuttoninthescenariomanagerdialogboxwillcreatethefollowingPivotTableof
possiblealternativeresults.Hereweseedetailedrevenueprojectionsforalltiresandlaborfeesgivenall
threepossiblescenariosof100%,110%,and120%markup.
Page85
Withafewsimplecopypastecommands,thenewlycreateddatacanbepositionedandformattednextto
theoriginalprojectionsasshowninthescreenbelow.
Ofcoursethescenariosabovecouldhavebeencreatedeasilyusingsimpleformulasinsteadofusingthe
scenariomanagertoolasdescribedabove.Thisunderscoresthatbestpurposeofscenariomanagerwhich
is to keep track of older and changing data through time, rather than producing whatif scenarios. For
example,acomplexprojectioncontainingscenariosbasedonoriginalassumptions,revisedassumptions,
and final assumptions will allow management to go back and review the assumptions used throughout
theproject,andseehowthoseassumptionschangedasprojectplanningprogressed.
DataTexttoColumns
Asdiscussedearlierinthismanual,oftenCPAsreceivedatafromtheirclientsorITdepartmentsthatisin
textform.Whenthishappens,Excelcansplitthecontentsofoneormorecellsinacolumnanddistribute
those contents as individual parts across other cells in adjacent columns. For example, the worksheet
below contains a column of full names and amounts that you want to split into separate columns. The
TexttoColumnsWizardparsesthedataautomaticallyintoseparate
Select the cell, range (range: Two or more cells on a sheet. The cells in a range can be adjacent or
nonadjacent.),orentirecolumnthatcontainsthetextvaluesthatyouwanttosplit.NoteArangethatyou
wanttosplitcanincludeanynumberofrows,butitcanincludenomorethanonecolumn.Youalsoshould
keepenoughblankcolumnstotherightoftheselectedcolumntopreventexistingdatainadjacent
Page86
DataConsolidate
Excelcancombine,summarize,andreportconsolidatedresultsfromseparateworksheets.Theunderlying
worksheets can be in the same workbook or in other separate workbooks. There are two different
sitautionsasfollows:
1. You Are Consolidating Similar Data Such as departmental budgets where every
worksheet contains the exact same labels in the exact same cells. In this case, you can
writeaSpearingFormulawhichcanconsolidatethenecessaryinformationeasily.
2. YouAreConsolidatingDisSimilarDataThevariousworksheetscontaindifferentrow
andcolumndescriptionslocatedindifferentlocationsontheworksheets.Inthiscaseyou
shouldusetheDataConsolidatecommand.
Page87
For example, assume that you have received budgets from multiple departments, and you want to
combinethemtogether.Inthiscase,Excelwilldotheworkforyou.Youcanuseaconsolidationtorollup
thesefiguresintoacorporatebudgetworksheet,asshownbelow.
Page88
DataGrouping&Outlining
Ifyouhavealistofdatathatyouwanttogroupandsummarize,youcancreateanoutlineofuptoeight
levels, one for each group. Each inner level, represented by a higher number in the outline symbols
displaysdetaildatafortheprecedingouterlevel,representedbyalowernumberintheoutlinesymbols.
Useanoutlinetoquicklydisplaysummaryrowsorcolumns,ortorevealthedetaildataforeachgroup.
Youcancreateanoutlineofrows(asshownintheexamplebelow),anoutlineofcolumns,oranoutlineof
bothrowsandcolumns.
WebQueries
Excelincludespredesignedqueriesthatcanimportcommonlyuseddatain10seconds.Forexample,
youcoulduseawebquerytocreateastockportfolio.AllyouneedisaconnectiontotheInternetandof
course, some stock ticker symbols. In Excel 2003 select Data, Import External Data, Import Data and
walk through the web query wizard for importing stock quotes. In Excel 2007 and later use the Data
Ribbon,ExistingConnections,StockQuotesoption.Inseconds,Excelwillretrieve20minutedelayedstock
pricesfromtheweb(duringthehourswhenthestockmarketisopen)anddisplayagridofcompleteup
todatestickpriceinformationthatissynchronizedtothestockmarketschangingstockprices.Witheach
Page89
click of the Refresh button, the stock price information in Excel is updated this sure beats picking
numbersoutofthenewspaper.
Completing the Stock Portfolio Next link the grid data to another worksheet, and
insert newcolumns containing the number ofshares owned, as wells as an additional
columntocomputerthetotalvaluebasedonsharesowned,asshownbelow.
RefreshingtheStockPricesOnceyouhavecreatedyourportfolio,simplyclicktheRefreshDatabutton
on the External Data Toolbar in Excel 2003 or on the Data Ribbon in Excel 2007 shown below to
updatethecurrentvalueofyourPortfolio.
Page90
Query Parameters There are numerous options to help you extract exactly the data
youwanttheywayyouwantit.TheWebQueryParametersBox,WebQueryOptions
boxandExternalDataPropertiesBoxprovidenumerousoptionsforcontrollingyour
webquery.
DatabaseQueries
MicrosoftExcelcanalsoqueryandretrievedatayouwantfromanexternaldatasource.
Forexample,youcanretrieveMicrosoftExceldataaboutaspecificproductbyregion.
You can create a simple query by using the Query Wizard, or you can create a more
complexquerybyusingtheadvancedfeaturesofMicrosoftQuery.
TouseMicrosoftQuerytoretrieveexternaldata,youmust:
1.
HaveaccesstoanexternaldatasourceIfthedataisnotonyourlocalcomputer,youmayneed
to see the administrator of the external database for a password, user permission, or other
informationabouthowtoconnecttothedatabase.
2.
InstallMicrosoftQueryIfMicrosoftQueryisnotavailable,youmightneedtoinstallit.
3.
Specifyasourcetoretrievedatafrom,andthenstartusingMicrosoftQueryForexample,if
you want to insert database information, display the Database toolbar, click Insert Database,
clickGetData,andthenclickMSQuery.
Forexample,supposewehavesomedatainouraccountingsystemSageMAS200ERPthatwewould
liketoanalyzeinExcel.WecanusetheDatabaseQueryWizardtobuildaquerythatwillextractthedata
weneedandplaceitinanExcelspreadsheet.
Page91
Thefirststepistoselectthetypeofdatabaseyouwanttoqueryandtoselectthespecificdatabase.
Page92
Upontheselectionofthedesireddatabasealistoftableswillbepresented.Choosethedesiredtables,
andselectthedesireddatafieldstobeimported.Youwillthenhavetheoptiontofilterandsortthedata
beforeitisimported.Finallyyouwillbegiventheoptiontosavethequerysothatyoucanrunitatalater
datewithouthavingtostartfromscratch.Excelwillthenreturnatablefullofthedatayourequestedas
showninthescreenbelow.
Page93
Page94
Chapter7
MACROS
AutomatingYourKeyStrokes
Page95
Macros
MacrosofferapowerfulandflexiblewaytoextendthefeaturesofExcel.Theyallowtheautomationof
repetitivetaskssuchasprinting,formatting,configuring,orotherwisemanipulatingdatainExcel.Inits
simplest form, a macro is a recording of your keystrokes. While macros represent one of the stronger
featuresfoundinExcel,theyarerathereasytocreateanduse.TherearesixmajorpointsthatIliketo
makeaboutmacrosasfollows.
1.
Record, Use Excel, Stop Recording To create a macro, simply turn on the
macrorecorder,useExcelasyounormallydo,thenturnofftherecorder.Presto
youhavecreatedamacro.Whiletheprocessissimplefromtheuserspointof
view, underneath the covers Excel creates a Visual Basic subroutine using
sophisticatedVisualBasicprogrammingcommands.
2. MacroLocationMacroscanbestoredineitheroftwolocations,asfollows:
a. Theworkbookyouareusing,or
b. YourPersonalMacroWorkbook(whichbydefaultishiddenfromview)
Ifyourmacroappliestoallworkbooks,thenstoreitinthePersonalMacroWorkbooksoitwill
alwaysbeavailableinallofyourExcelworkbooks;otherwisestoreitinyourcurrentworkbook.A
macrostoredinyourcurrentworkbookwillbeembeddedandincludedintheworkbook,evenif
youemailtheworkbooktoanotheruser.
3. AssignyourMacrotoanIcon,TextoraButtonTomakeiteasytorunyour
macro, you should assign it to a toolbar icon so it will always be available no
matter which workbooks you have open. If the macro applies only to your
currentworkbook,thenassignittoTextoramacroButtonsoitwillbequickly
availableinyourcurrentworkbook.
4. AbsoluteversusRelativeMacrosAnAbsolutemacrowillalwaysaffectthe
samecellseachtimewhereasaRelativemacrowillaffectthosecellsrelativeto
whereyourcursorispositionedwhenyouinvokethemacro.Itiscrucialthatyou
understandthedifference.
5. EditingMacrosOncecreated,youcanviewand/oredityourmacrousingthe
View Macros option. This will open the macro subroutine in a Visual basic
programmingwindowandprovideyouwithaplethoraofVBtools.
6. AdvancedVisualBasicProgrammingForthetrulyambitiousCPA,intheVisual
BasicProgrammingwindow,youhavethenecessarytoolsyouneedtobuildvery
sophisticatedmacroswithdialogboxes,dropdownmenuoptions,checkboxes,
radiobuttonsthewholeworks.Iinviteyoutoknockyourselfout.Toseeallof
thispower,turnontheDeveloperTabinExcelOptions(seebelow).
Page96
Presentedbelowaremoredetailedcommentsandstepbystepinstructionsforcreatingandinvoking
macros,followedbysomeexamplemacros.
1. CreatingaMacroTocreateamacro,clickRecordMacrointheCodeGroupontheDeveloper
Tab.
a. AssignaNameIntheMacroNamebox,enteranameforthemacro.
i. Thefirstcharacterofthemacronamemustbealetter.
ii. Subsequentcharacterscanbeletters,numbers,orunderscorecharacters.
iii. Spacescannotbeusedinamacroname(anunderscorecharacterisoften
usedasawordseparator.
iv. Ifyouuseamacronamethatisalsoacellreference,youmaygetanerror
messagethatthemacronameisnotvalid.
b. AssignaCTRLCombination(optional)YoucanassignaCTRLcombinationshortcutkey
torunthemacrobytypinganylowercaseletteroruppercaseletterthatyouwanttouse
intheShortcutkeybox.
i. The shortcut key will override any equivalent default Excel shortcut
keywhiletheworkbookthatcontainsthemacroisopen.
c. MacroLocationIntheStoreMacroInlist,selecttheworkbookwhereyouwant
tostorethemacro.
i. Asmentionedabove,ifyouwantamacrotobeavailablewhenever
youuseExcel,selectPersonalMacroWorkbook.Whenyouselect
PersonalMacroWorkbook,Excelcreatesahiddenpersonalmacro
workbook(Personal.xlsb)ifitdoesnotalreadyexist,andsavesthemacro
inthisworkbook.
ii. InWindowsVista,thisworkbookissavedintheC:\Users\user
name\AppData\Local\Microsoft\Excel\XLStartfolder.
iii. InMicrosoftWindowsXP,thisworkbookissavedintheC:\Documents
andSettings\username\ApplicationData\Microsoft\Excel\XLStartfolder.
iv. WorkbooksintheXLStartfolderareopenedautomaticallywhenever
Excelstarts.
v. Ifyouwantamacrointhepersonalmacroworkbooktoberun
automaticallyinanotherworkbook,youmustalsosavethatworkbookin
theXLStartfoldersothatbothworkbooksareopenedwhenExcelstarts.
d. MacroDescriptionIntheDescriptionbox,typeadescriptionofthemacro.
e. StartRecordingClickOKtostartrecording.
f. StartTypingPerformtheactionsthatyouwanttorecord.
g. StopRecordingWhenyouaredoneclickStopRecordinginthe
CodeGroupOntheDeveloperTab.
i. YoucanalsoclickStopRecordingontheleftsideofthe
statusbar.
Page97
h. Assignamacrotoanobject,graphic,orcontrolOnaworksheet,
rightclicktheobject,graphic,orcontroltowhichyouwanttoassign
anexistingmacro,andthenclickAssignMacro.IntheMacroname
box,clickthemacrothatyouwanttoassign.
2. MenuNavigationNotRecordedWhenyourecordamacro,themacrorecorder
recordsallthestepsrequiredtocompletetheactionsthatyouwantyourmacro
toperform.NavigationontheRibbonisnotincludedintherecordedsteps,only
thecommandsthatareexecutedarerecordedinthemacro.
3. Turn On The Developer Tab Turn on the Developer tab by clicking the
Microsoft Office Start Button, and then click Excel Options. In the Popular
category,underTopoptionsforworkingwithExcel,selecttheShowDeveloper
tabintheRibboncheckbox,andthenclickOK.
Page98
UnderMacroSettings,clickEnableallmacros(notrecommended,potentiallydangerouscodecan
run),andthenclickOK.
5. ExampleMacros
a. Page Setup Macro Start recording a new macro called page setup.
SelectalloftheworksheetsandthenchoosePageSetupandcustomize
theheaderandfooterstoincludepagenumbers,dateandtimestamps,
filelocations,tabnames,etc.AssignthemacrotoanIcononyourtoolbar
orQuickAccessBarandinsettingheadersandfooterswillbeabreezefor
therestofyourlife.
b. PrintMacrosDoyouhaveatemplatethatyouprintfrequentlyfrom?If
so,insertseveralmacrobuttonstoprinteachreport,agroupofreports,
andevenmultiplereportsandreportingwillbesnapinthefuture.
c. Delete Data Macro Do you have a template that you use often that
containsalotofvariables?Ifso,createamacrothatvisitseachcelland
erasesthatdata,resettingtheworksheetforuseinanewsetofcriteria.
Assign the macro to a macro button and you will never again have old
assumptionsmixedinwithyournewertemplate.
Page99
Chapter8
Solver
Page100
Solver
SolverisoneofthemorepowerfulfeaturesinExcelbecauseitcansolveforoptimum
results in complex worksheets while obeying stated constraints. With Solver, you can
find an optimal value for a formula by manipulating a group of cells that are related,
eitherdirectlyorindirectly,totheformulainthetargetcell.Solveradjuststhevaluesin
theadjustablecellstoproducetheresultyouspecifyfromthetargetcellformula.You
can apply constraints to restrict the values Solver can use in the model, and the
constraintscanrefertoothercellsthataffectthetargetcellformula.
Intheportfolioexampleshownbelow,theuserwishestodeterminehowmuchmoney
toinvestinvariousinvestmentsinordertomaximizethereturnonthoseinvestments.
Of course the maximum results can be achieved by simply place in all monies in the
investmentthatyieldsthehighestresults,howeverthisapproachviolatesthedontput
allofyoureggsinonebasketrule.Inthiscasetheuserwantstodiversifytheirfunds
across many types of investments. Therefore constraints are established such as no
morethan35%offundscanbeinvestedinbluechipstocksandthecheckingaccounting
mustcontainatleast$100,000.
Aportfolioisshownbelowandsomeconstraintshavebeenincludedinlustform.These
constraintswillneedtobestatedintermsofformulasinthesolvermanagerdialogbox.
Page101
ThekeytomakingsolverworkisthesolverParametersdialogboxshownbelow.
Thetargetcellissettorefertothetotalportfoliovalueattheendoftheyearbecause
thisisthevaluethatwewanttomaximize.Thechangingcellsaresettoreferencethe
percentages of each investment. Finally the various constraints are expressed as
formulasasshowninthelowerlefthandcornerofthedialogbox.Oncesolverhasbeen
run once, the solver formulas stick to the worksheet and the results are changed and
updated as the various assumptions in the worksheet are changed and updated. For
example, you may later determine that the growth rate for real estate is a different
amount.InputtingthatnewamountintheworksheetwillcauseExceltoautomatically
adjust all variables to produce the optimum investment mix that maximizes earnings
withoutviolatinganystatedconstraints.
Page102
Chapter 9
EXAMPLE
Case Studies
Page103
TrickExcelintoCreatingaGanttChart
LetsstartbytrickingExcelintocreatingaGanttChart.OfcourseExceldoesnotdoGanttcharts,sowe
willapplyclevertrickstoachievethedesiredaffects.Itsreallynotthathardanditworksjustaswellin
Excel2003asitdoesinExcel2007.Startbypreparingasimplelistoftasksincludingstartdates,duration
ofeachtask,andenddates(formulasinExcelcancalculatetheenddates).Anexampleisshownbelow:
1. Startbycreatingastackedbarchart
2. RemovetheDataSeriesbyrightmouseclickingandchoosingSelectDataSource
3. AddanewDataSourceNamedStartingDate,andpointtotherangeofstartdatesfor
thevalues
4. AddanothernewdatasourcenamedDuration(Days),andpointtotherangeof
durationdaysforthevalues
5. AddCategoryAxisLabelsandpointtotheTasknamesinColumnA
6. RemovelegendbyselectinglegendandpressingtheDeletekey
7. ClickonthebeginningseriesandsettheFillandBorderstoNone
8. Rightmouseclickonthetasklabels,chooseformatAxis,andchecktheCategoriesin
ReverseOrderbox(ifneeded)
9. Intwoblankcells,writeaformulareferencingthestartandenddates,convertthese
datestonumberswithformatting
10. UsetheresultingnumberstosetthescaleoftheGanttChart(perhapsuseaslightly
largerrangeofdates)
11. Rightmouseclickonthedaterange,settheminimumandmaximumstofixedusingthe
numbersacquiredintheabovestep
12. Formatthedaterangetoshowashortdate
13. Formattheremainingdatabarstodisplaya3Dbevel
14. Foraddedtouch,searchGoogleimagesforanicepictureofahouse,saveittoyourhard
drive.
15. Setthebackgroundplotareatopicture,andwashoutthepictureenoughsothatthe
chartisstillreadable.
16. AddatitleortextboxesasneededtocompletethedescriptionoftheGanttChart
TheresultingGanttchartisshownbelow.Atthispoint,changinganyofthestartdatesordurationdates
willautomaticallyupdatetheGanttchart.
Page104
CombinationChart
Page105
As we can see by the resulting combination chart, approximately 26 hours of study are required each
weekinordertoachieveanaveragegradeof90orabove,andapproximately20to22hoursofstudyare
requiredeachweektoachieveaBaverageabove80.Inournextcasestudywemightwanttoanalyze
whethertheamountofmoneyhisparentssendtohimeachweekaffectsthenumberofhoursofstudyhe
putsfortheachweek.
CreatinganOrganizationChart
NextwewillcreateanorganizationalchartusingtheSmartArtcapabilitiesinExcel2007.Excel2003offers
asimilartool,butnotaspretty.StartbychoosingSmartArtandpointtothedesiredchartformat.
Page106
PortfolioCaseStudy
TheSituationYourindividualclient(Mr.Slade)hasbeenverysuccessfulinhisbusiness
dealings,andhasaccumulated$1millionincashandinvestments.PreviouslyMr.Slade
has invested these funds rather haphazardly, in a potpourri of investments without
much strategy or thought. Presented below is a summary of his funds as they are
currentlyinvested:
Cash
275,000
SpeculativeStocks
400,000
MutualFunds
325,000
InspeakingwithMr.Slade,withyourhelphedeterminesthathewouldliketospread
hisinvestmentsaroundinavarietyofinvestmentsinanefforttodiversifyhisportfolio.
Together,youcomeupwiththefollowingcriteriaforMr.Sladesinvestmentstrategy:
1. Mr. Slade wants to spread his investments around, including blue chip stocks,
growthstocks,speculationstocks,cash,realestateandmutualfunds.
2. Mr.Sladeneedsbetween$100,000and$150,000inliquidcash.
3. Mr.Sladewantstocarryabout25%to35%oftheportfolioinbluechipstocks.
4. Mr.Sladewouldliketonomorethan20%oftheportfolioinvestedinspeculative
stocks.
5. Mr.Sladewantsnomorethan20%ofhisinvestmentsinmutualfunds.
Thenextstepinthisprocessistoestimatetheexpectedreturnoninvestment(ROI)for
eachofinvestments.Someofthesenumbersareeasytocomebyandsomearealittle
more difficult. For example, it is known that the checking account pays 2.2% interest,
andofcoursethereisnogrowth.Mr.Sladesspeculativestockinvestmentshavegrown
Page107
atanaverageof12%,withnodividendpaymentswhilehismutualfundshavegrown7%
peryear.Alittleresearchrevealsthatbluechipstocksgrowonaverage6.0%peryear,
andpayabout4%individendsannually,andgrowthstocksgrowatabout8%peryear.
Therealestatemarkethasshownsteadygrowthof12%peryear,butthereisanannual
costofabout3.5%fortaxes,insuranceandmaintenance.
Mr.Sladewantsyoutohelphimfigureoutwhichportfoliomixmaximizeshisearnings,
while obeying his stated constraints. Thereafter, Mr. Slade wants you to set up a
organizedapproachfortrackingtheseinvestmentsinthefuture.
TheBigPictureYourGoalsAre:
1. InstalltheSolvertoolinExcel.
2. UseSolvertocalculatethebestmixofinvestmentsthatalsoobeysMr.Slades
statedinvestmentgoalsandcriteria.
3. SetupanExcelworksheetthatorganizesandtrackstheseinvestments.
4. Create web queries that will import stock prices and mutual fund information
directlyintoExcel.
ThisCaseStudyCoversthefollowingExcelFeaturesandConcepts:
1. Addins
9. WebQueryParameters
2. SolverOverview
10. EditingWebQueries
3. SolverWorksheet
11. RefreshingWebQueries
4. SolverConstraints
12. Subtotaling
5. SolverTargets
13. Outlining
6. SolverReporting
14. Tables
7. PortfolioDesign
15. PivotTables
8. WebQueries
16. FormatGallery
Steps:
1. TousetheSolverAddin,youneedtoloaditfirst.Todothis,ClicktheMicrosoft
Office Button, and then click Excel Options. Click AddIns, and then in the
Manage box, select Excel Addins. Click Go. In the AddIns available box, select
theSolverAddincheckbox,andthenclickOK.AfteryouloadtheSolverAddin,
theSolvercommandisavailableintheAnalysisgroupontheDatatab.
Page108
2. SetuptheInvestmentMixworksheet,startingwiththerowandcolumnlabels
shownbelow.
3. Enterthepercentagereturnsforeachinvestment,includingearningsandgrowth
rate. Note that the earnings rate for real estate is a negative number because
theownermustpaymoneyannuallyfortaxes,insuranceandmaintenance.
4. Enteranamountoffundsforeachinvestment,thetotalofwhichsumstothe$1
millionthatMr.Sladeowns.Itdoesnotmatterwhichamountsyouenterhere;
thesearetheamountsthatwilleventuallybeadjustedbySolver.(Forexample,
you could enter $1 for the first five investments and $999,995 for the last
investmentifyouwantedto.)
Page109
5. Enterformulastocalculatethepercentageofeachinvestmentasapercentage
tothetotalinvestments.Thisisbestaccomplishedbytypinginthetopformula,
applying absolute references to the denominator, and double clicking the fill
handletocopytheformuladown.
6. Enter the remaining formulas to complete the schedule. These formulas are
straight forward and they are best accomplished by typing the formula once,
applyingtheproperabsolutecolumnreferencetotheAmountofInvestment
cellreference,andthencopyingthisformuladownandacross.Thefinalcolumn
simplysumstheearningsandgrowthtoderiveatotalreturnoninvestment.
7. Presentedbelowisanauditingviewofthisschedulewithalldataandformulas
displayed so that you can check your work. This computation represents the
SolverProblemwhichSolverwithsolve.
Page110
8. Nowthatyourinvestmentscheduleiscomplete,youarereadytousesolverto
determinetheoptimuminvestmentmixthatyieldsthetopreturn,yetobeysMr.
Slades stated investment objectives. Launch the Solver tool from the Data
menusAnalysischunk.
9. Enter the Constraints into the solver Parameters dialog box one at a time. For
example, the amount of cash is tobe at least$100,000 and at most$150,000.
Theseconstraintsareexpressedas$F$8>=100000and$F$8<=150000.
Further,inordertomakesolverwork,youmustaddtwoadditionalconstraints
asfollows.Aconstraintthattellssolverthetotalamountofavailablefundsmust
also be added by instructing Solver that total funds are $1,000,000. Another
constraintthatindicatesthatnoinvestmentshallbelessthan$0.00mustalsobe
added, otherwise solver will try to maximize earnings by suggesting negative
Page111
investment amounts. (Sure, this sounds crazy, but Solver is not a thinking
intelligentbeing,itsjustacalculation.)
10. Complete the Solver by referencing the cells to be changed and the cell to be
maximizedinthesolution.Thecellstobechangedarethe6cellscontainingthe
amountstobeinvestedineachtypeofinvestment,asshowninthedottedline
boxbelow.
11. The cell to be maximized is the total amount of return on investment, or the
totaloftheProjectedTotalcolumn.
SolverisReadytoRun
12. Withallconstraints,changingcells,andmaximizedcellproperlyreferenced,you
arenowreadytoproducethesolutionbypressingtheSolvebutton.Thisaction
willadjusttheportfoliomixscheduletoprovidethosetopresultswhichobeythe
statedinvestmentobjectives.
Page112
Asyoucanseebythesereneabove,solverhasadjustedtheportfolioinvestment
mix to show that total earnings of $90,950 can be achieved by maximizing the
investments in blue chip stocks, avoiding growth stocks, placing the minimum
amountof$100,000inchecking,etc.Afterproducingthisreport,Mr.Slademay
decide that additional constraints are needed, and if so, the numbers can be
massagedaccordingly.
13. Solvernowoffersavarietyofoptionsforreportingtheresults.Thereportcanbe
savedasascenario.Thereafter,Solverwillproducevariousreportstohelpyou
understandtheresults.ThefirstofthesereportsistheAnswersReportshownto
theright.
Page113
14. TheSensitivityandLimitReportsprovidedetailsintohowthefinalanswerswere
derived.
15. Now that the Portfolio Investment Mix and Solver worksheets have both been
created, they can be rerun as frequently as desired in just a few seconds. For
example, assume that the checking account interest rate changes, blue chip
returns fall, and Mr. Slades objectives change. This is no problem as you can
open the worksheets and make these adjustments in only a few seconds.
Specifically,assumethatMr.Sladedecidesthatatleast10%oftheinvestments
shouldbeinvestedinMutualfunds.SimplyaddthisnewconstrainttoSolverand
recomputedtheresults.
Asmarketconditionschange,theInvestmentMixScheduleassumptionscanbe
updatedandSolvercanbereruntoproducenewresults.Thereafter,Mr.Slade
needsonlytotrackinvestmentsandmovethemaroundastheamountsgrowto
matchhisdesiredinvestmentgoals.
16. ThenextstepistoassistMr.Sladeinselectinginvestmentsfromeachcategory,
andthencreatingaworksheettotrackthoseinvestments.Whiletheselectionof
eachindividualinvestmentiscomplex,strategicandpersonal(andhencebeyond
Page114
thescopeofthiscasestudy),letusassumethatMr.Sladehasdecideduponthe
followingspecificinvestments:
Category
BlueChipStocks
BlueChipStocks
BlueChipStocks
BlueChipStocks
BlueChipStocks
BlueChipStocks
BlueChipStocks
Symbol
MSFT
T
DOW
DD
UPS
XOM
KO
CompanyName
Microsoft
AT&TInc.
DowChemical
DuPont
UPS
ExonMobil
CocaCola
SpeculationStocks
SpeculationStocks
SpeculationStocks
SpeculationStocks
GOOG
ORCL
IN
MRK
Google
Oracle
Intermec
Merck
CheckingAccount
50,000
50,000
50,000
50,000
100,000
RealEstate
MutualFund
MutualFund
MutualFund
IntialAmount
50,000
50,000
50,000
50,000
50,000
50,000
50,000
FFIDX
EDSIX
AFATX
UndevelopedLand
Townhome
70,000
180,000
FidelityFund
50,000
25,000
25,000
17. SetupaninitialPortfoliothatlisttheseinvestmentsandtheinitialamountsthat
Mr. Slade has decided to place in each investment. Include a column for share
priceandthetotalnumberofsharesasshownbelow.
1,000,000
18. Onaseparatesheet,insertaWebQuerytoretrievethesestockandmutualfund
pricesusingthetickersymbolsprovided.Todothis,selectExistingConnections
Page115
from the Data Ribbons Get External Data Chunk, and select Stock Quotes.
EnterthetickersymbolsintheEnterParameterValuedialogboxshownbelow.
Be sure to check the checkbox titled Use this value/reference for future
refreshes.
19. This action will cause Excel to reach out to a stock portfolio database on the
Internetandcreatethefollowingsummaryreport:
20. ReturntothePortfolioandinsertformulastopullstockpricedatafromtheweb
queryintothePortfolioasshownbelow.
Page116
21. Addformulasinthesharescolumnbydividingtheamountofeachinvestmentby
thesharepriceinordertodeterminetheappropriatenumberofsharesofeach
investmentMr.Sladeshouldpurchasetomeethisinvestmentgoals.Besureto
usetheroundfunctionandroundtothenearesttenth.
22. OnceMr.Sladehasmadeallofthenecessaryinvestments,recreatetheportfolio
onanewsheet,andmakethenecessaryadjustmentstoreflecttheactualresults
of these transactions. Due to the requirements of purchasing bocks of shares,
Mr. Slade will not be able to purchase the exact number of shares indicated
above at the exact same price indicated above. Therefore there will be slight
discrepancies. Once those transactions are completed, Mr. Slade will need a
worksheet that documents the beginning point in which Mr. Slade begins to
trackhisinvestments.Forexample,theresultingPortfoliomightlooklikethis:
Page117
23. Oncecreated,theportfoliocanbeupdatedatanytimebypressingtheRefresh
Databutton.Asanexample,justmomentsaftercompletingthisportfolio,Mr.
Sladesinvestmentshadgrownby$1,651,asshownbelow.Ofcoursechangesin
the real estate holdings and checking account balance will need to be input
manuallyonaperiodicbasissuchasevery6monthsoreachyear.
24. Next,practiceconvertingthisdatatobothatable,andaPivotTable.Therefore
selectthetopcellreferencingtheshareprice,andpressF2andthenF$totoggle
ontheabsolutereferences.Usethedownarrowandrepeatthisuntilallshare
formulas have an absolute reference. Copy the Portfolio to a new sheet, and
againtoyetanothernewsheet.
25. Select oneof the portfolio examples and apply Subtotals to the Portfolio using
the Subtotal tool from the Data Ribbons Outline Chunk. This action will
automaticallysubtotalthePortfoliobycategoryasshownbelow.
Page118
26. ConverttheportfoliotoatableusingtheTabletoolfromtheInsertRibbons
TablesChunk.Thiswillautomaticallyapplyformattinganddropdownfilters
tothePortfolio.Yuchangetheformattingusingthegalleryorbyapplyingnew
formatstoindividualrowsorcolumns.
27. Next click the Outline selection number 2 to display the collapsed version of
thedata,displayingsubtotalsandgrandtotalsonly.
Page119
28. NowselectthesecondcopyofthePortfolio,andwithyourcursorpositionedon
any cell in the table, select the PivotTable tool from the Insert Ribbons
PivotTableChunk.ThisactionwillproduceanewSheetwithaBlankPivotPallet
displayedasshownbelow.
29. InthePivotTableFieldListdialogbox,checktheCategory,CompanyName
andTotalcolumn.NextdragtheCategoryfieldfromtheRowLabelsboxand
drop it in the Column labels box. The resulting pivot report should appear as
follows:
Page120
30. FinishbyformattingthetablewithaDarkdesignfromtheFormatasTable
toolontheHomeRibbonsStyleschunk.Alsoapplycommaformatting.
SumofTotal
RowLabels
Afba5StarScience&Technology
AT&TInc.
CocaCola
DowChemical
DuPont
EvergreenDisciplinedValueFund
ExonMobil
FidelityFund
Google
Intermec
Merck
Microsoft
Oracle
UPS
(blank)
GrandTotal
ColumnLabels
BlueChipStocks
CheckingAccount
MutualFund RealEstate
25,326
SpeculationStocks
48,048
48,190
50,616
51,020
25,466
44,844
51,310
47,500
49,200
48,312
50,628
49,770
51,800
345,146
109,621
109,621
102,102
250,000
250,000
194,782
GrandTotal
25,326
48,048
48,190
50,616
51,020
25,466
44,844
51,310
47,500
49,200
48,312
50,628
49,770
51,800
359,621
1,001,651
Inconclusion,youhaveassistedMr.Sladeinplanninganinvestmentstrategywhich
diversifies his holdings, yet maximizes earnings. Additionally, you have created a
worksheetthattrackstheseinvestments.Asallofthefactorschange,Mr.Sladecan
easily determine which monies, if any, need to be moved around to maintain his
desireddiversity.Forexample,assumethatMr.Slademakesanadditional$200,000
in2007,andhischeckingaccountincreasesaccordingly.Heneedonlyinsertthenew
checkingaccountbalanceintosolver,alongwithanyotherknownadjustmentssuch
as changes in earnings, and rerun solver to obtain a new mix, which can be
compared to the current investment mix to determine which investments need to
beadjusted.
Page121
Chapter 10
Excel Advanced
Digging Deeper into
Excels
Fundamentals
Page122
ExcelFunctions
Functions are basically prewritten formulas, but you must follow the proper syntax to
usethem.Thereareatotalof348FunctionsbuiltintoExcel,categorizedasfollows:
1
2
3
4
5
6
7
8
9
10
11
12
13
FunctionCategories
Addin
Cube
Database
Dateandtime
Engineering
Financial
Information
IS
Logical
Lookup/Reference
Math/Trig
Statistical
Text
TotalFunctions
NumberofFunctions Carlton'sListofBest
PerCategory
FunctionsforCPAs
5
1
7
4
12
7
20
8
39
0
53
8
7
3
11
2
7
6
17
7
60
8
83
8
27
15
348
77
Many of these functions represent powerful tools for the CPA while others represent
toolsthathavelimitedCPAapplication.ForexamplemostCPAshavelittleapplications
for CPAs for trigonometry functions that calculate logarithms, seines, or cosines, and
perhaps even less opportunities to use engineering functions such as gammas,
hypergeometricdistribution,orcoefficientsofcomplexnumbers.Basedonmyyearsof
using Excel in a CPA environment, I find that the following 77 functions are most
applicabletoCPAs:
Addin:
=GETPIVOTDATA
Database:
=DCOUNT
=DCOUNTA
=DGET
=DSUM
Dateandtime:
=DATE
=DATEVALUE
=DAY
=TODAY
ReturnsdatastoredinaPivotTablereport
Countsthecellsthatcontainnumbersinadatabase
Countsnonblankcellsinadatabase
Extractsasingledatabaserecordthatmatchesthespecifiedcriteria
Addsnumbersinthedatabasethatmatchthecriteria
Returnstheserialnumberofaparticulardate
Convertsadateintheformoftexttoaserialnumber
Convertsaserialnumbertoadayofthemonth
Returnstheserialnumberoftoday'sdate
Page123
=WEEKDAY
=WEEKNUM
=YEAR
Financial:
=FV
=INTRATE
=IPMT
=IRR
=NPV
=PMT
=PV
=RATE
Information:
=CELL
=INFO
IS:
=ISBLANK
=ISERR
Logical:
=AND
=FALSE
=IF
=IFERROR
=NOT
=OR
Lookup/Reference
=ADDRESS
=CHOOSE
=HLOOKUP
=HYPERLINK
=LOOKUP
=TRANSPOSE
=VLOOKUP
Math/Trigonometry
=RAND
=RANDBETWEEN
=ROUND
=ROUNDDOWN
=ROUNDUP
=SUBTOTAL
=SUM
Convertsaserialnumbertoadayoftheweek
Convertsaserialnumbertoweeknumber1thru52
Convertsaserialnumbertoayear
Returnsthefuturevalueofaninvestment
Returnstheinterestrateforafullyinvestedsecurity
Returnstheinterestpaymentforaninvestmentforagivenperiod
Returnstheinternalrateofreturnforaseriesofcashflows
Returnsthenetpresentvalueofaninvestmentbasedonaseriesof
periodiccashflowsandadiscountrate
Returnstheperiodicpaymentforanannuity
Returnsthepresentvalueofaninvestment
Returnstheinterestrateperperiodofanannuity
Returnsinformationabouttheformatting,location,orcontentsofacell
Returnsinformationaboutthecurrentoperatingenvironment
ReturnsTRUEifthevalueisblank
ReturnsTRUEifthevalueisanyerrorvalueexcept#N/A
ReturnsTRUEifallofitsargumentsareTRUE
ReturnsthelogicalvalueFALSE
Specifiesalogicaltesttoperform
Returnsavalueyouspecifyiferror;otherwise,returnstheresult
Reversesthelogicofitsargument
ReturnsTRUEifanyargumentisTRUE
Returnsareferenceastexttoasinglecellinaworksheet
Choosesavaluefromalistofvalues
Looksinthetoprowofanarrayandreturnsthevalueoftheindicatedcell
CreateslinktoopenadocumentstoredonyourcomputerortheInternet
Looksupvaluesinavectororarray
Returnsthetransposeofanarray
Looksinthefirstcolumnofanarrayandmovesacrosstherowtoreturn
thevalueofacell
Returnsarandomnumberbetween0and1
Returnsarandomnumberbetweenthenumbersyouspecify
Roundsanumbertoaspecifiednumberofdigits
Roundsanumberdown,towardzero
Roundsanumberup,awayfromzero
Returnsasubtotalinalistordatabase
Addsitsarguments
Page124
=SUMIF
Text:
=CLEAN
=CONCATENATE
=FIND,
=LEFT,
=LEN,
=LOWER
=MID,
=PROPER
=REPLACE,
=RIGHT,
=SUBSTITUTE
=TEXT
=TRIM
=UPPER
=VALUE
Statistical:
=AVERAGE
=COUNT
=COUNTA
=COUNTBLANK
=COUNTIF
=MAX
=MEDIAN
=MIN
Addsthecellsspecifiedbyagivencriteria
Removesallnonprintablecharactersfromtext
Joinsseveraltextitemsintoonetextitem
Findsonetextvaluewithinanother(casesensitive)
Returnstheleftmostcharactersfromatextvalue
Returnsthenumberofcharactersinatextstring
Convertstexttolowercase
Returnsspecificcharactersfromatextstringstartingwhereyouspecify
Capitalizesthefirstletterineachwordofatextvalue
Replacescharacterswithintext
Returnstherightmostcharactersfromatextvalue
Substitutesnewtextforoldtextinatextstring
Formatsanumberandconvertsittotext
Removesspacesfromtext
Convertstexttouppercase
Convertsatextargumenttoanumber
Returnstheaverageofitsarguments
Countshowmanynumbersareinthelistofarguments
Countshowmanyvaluesareinthelistofarguments
Countsthenumberofblankcellswithinarange
Countsthenumberofcellswithinarangethatmeetthegivencriteria
Returnsthemaximumvalueinalistofarguments
Returnsthemedianofthegivennumbers
Returnstheminimumvalueinalistofarguments
Functionscansavetimeandpromoteaccuracy.Bestofall,theyeliminatetheneedfor
CPAstocreatecomplexformulasbecausethesefunctionsdomostoftheworkforyou.
TofullyutilizefunctionsinExcel,ausershouldstudythevariousfunctionslistedabove
andbeawareofthefollowingfacetsregardingfunctions:
1.
2.
3.
4.
5.
TheInsertFunctionTool
FormulaAutoComplete,SyntaxReminder,InsertFunctionoptions
InsertFunctionHelp
TheAutoSumFunctionTool
Demonstrationofthefollowingselectedfunctions:
Page125
DownloadanexampleExcelworksheetfromthewebwhichdemonstrateseachofthese
functionconceptsatthefollowingwebsiteaddress:
www.exceladvisor.net/functions.htm
Page126
Formatting:
FormulasandFunctionsrepresentthepowerExcelhastooffer,butyourfinalproduct
must be neat, readable, and wellorganized. Excels builtin formatting tools are
designedtohelpyouproducefinancialreportsanddatathatareofpresentationquality.
ThekeyformattingconceptsthatCPAsshouldbeawareofareasfollows:
1. NumberFormatsControllingcommas,decimals,currencysymbols,and
negatives.
2. DateFormatsControllingdays,months,years,seconds,hoursandminute.
3. AlignmentLeft,Middle,Right,Top,Middle,&Bottom.
4. AlignmentTextWrapping.
5. AlignmentTextOrientation.
6. AlignmentTextShrinktoFit.
7. AlignmentTextDirection.
8. FontsFontSize,Bold,Italics,Color.
9. FontsStrikethroughs,Superscripts&Subscripts.
10. FontsInCellFormattingCharacterbyCharacter.
11. FontsUnderlines&DoubleUnderlines.
12. CellsBorders,Colors&LineStyles.
13. CellsFillColors&FillEffects.
14. CellsMergingCells.
15. CellsFillColor,Pattern,Effect.
16. ConditionalFormattingHighlightingwithColors.
17. ConditionalFormattingTop&BottomFormatting.
18. ConditionalFormattingDataBars.
19. ConditionalFormattingTrafficLights.
20. ColumnWidthandRowHeightChangingoneroworcolumn.
21. ColumnWidthandRowHeightChangingmultiplerowsorcolumns.
22. ColumnWidthandRowHeightAutoadjustingrowheightandcolumnswidths.
23. StylesUsingExcelsDefaultStyles.
24. StylesCreatingCustomStyles.
25. TablesTableFormatting.
DownloadanexampleExcelworksheetfromthewebwhichdemonstrateseachofthese
formattingconceptsatthefollowingwebsiteaddress:
www.exceladvisor.net/formetting.htm
Page127
Microsoft
ExcelXML
Chapter11
Page128
OverviewofXMLinExcel
HideAll
Microsoft Office Excel makes it easy to import Extensible Markup Language (XML)(Extensible
MarkupLanguage(XML):AcondensedformofStandardGeneralizedMarkupLanguage(SGML)
that enables developers to create customized tags that offer flexibility in organizing and
presenting information.) data that is created from other databases and applications, to map
XMLelementsfromanXMLschema(XMLSchema:Aformalspecification,writteninXML,that
definesthestructureofanXMLdocument,includingelementnamesandrichdatatypes,which
elements can appear in combination, and which attributes are available for each element.) to
worksheet cells, and to export revised XML data for interaction with other databases and
applications.ThinkoftheseXMLfeaturesasturningOfficeExcelintoanXMLdatafilegenerator
withafamiliaruserinterface.
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?
XML is a technology that is designed for managing and sharing structured data in a human
readabletextfile.XMLfollowsindustrystandardguidelinesandcanbeprocessedbyavarietyof
databasesandapplications.UsingXML,applicationdesignerscancreatetheirowncustomized
tags, data structures, and schemas. In short, XML greatly eases the definition, transmission,
validation,andinterpretationofdatabetweendatabases,applications,andorganizations.
XMLdataandschemafiles
ExcelworksprimarilywithtwotypesofXMLfiles:
XMLdatafiles(.xml),whichcontainthecustomtagsandstructureddata.
Schema files (.xsd), which contain schema tags that enforce rules, such as data type and
validation.
NoteThe XML standard also defines Extensible Stylesheet Language Transformation
(XSLT)(XSL Transformation (XSLT): A file that is used to transform XML documents into other
types of documents, such as HTML or XML. It is designed for use as part of XSL.) (.xslt) files,
whichareusedtoapplystylesandtransformXMLdataintodifferentpresentationformats.You
canapplythesetransformsbeforeyouimportXMLfilesintoExcelandafteryouexportXMLfiles
fromExcel.IfXSLTfilesarelinkedtoXMLdatafilesthatyouimportintoExcel,youdohavethe
Page129
optiontoapplyornotapplytheformattingbeforethedataisaddedtotheworksheet,butonly
whenyouopenanXMLfilebyusingtheOpencommandontheMicrosoftOfficeButton.
KeyXMLandExcelscenarios
By using XML and Excel, you can manage workbooks and data in ways that were previously
impossibleorverydifficult.ByusingXMLmaps,youcaneasilyadd,identify,andextractspecific
piecesofbusinessdatafromExceldocuments.Forexample,aninvoicethatcontainsthename
andaddressofacustomerorareportthatcontainslastquarter'sfinancialresultsarenolonger
just static reports. You can easily import this information from databases and applications,
reviseit,andexportittothesameorotherdatabasesandapplications.Thefollowingarekey
scenariosthattheXMLfeaturesaredesignedtoaddress:
1. Extend the functionality of existing Excel templates by mapping XML elements onto
existing cells. This makes it easier to get XML data into and out of your templates
withouthavingtoredesignthem.
2. Use XML data as input to your existing calculation models by mapping XML elements
ontoexistingworksheets.
3. ImportXMLdatafilesintoanewworkbook.
4. ImportXMLdatafromaWebserviceintoyourExcelworksheet.
5. Export data in mapped cells to XML data files independent from other data in the
workbook.
ThebasicprocessofusingXMLdatainExcel
The following diagram shows how the different files and operations work together when you
useXMLwithExcel.Essentially,therearefivephasestotheprocess:
AddinganXMLschemafile(.xsd)toaworkbook
MappingXMLschemaelementstoindividualcellsorXMLtables
ImportinganXMLdatafile(.xml)andbindingtheXMLelementstomappedcells
Enteringdata,movingmappedcells,andleveragingExcelfunctionality,whilepreserving
XMLstructureanddefinitions
5. ExportingreviseddatafrommappedcellstoanXMLdatafile
1.
2.
3.
4.
6.
Page130
WorkingwithXMLmaps
YoucancreateoropenaworkbookinExcel,attachanXMLschemafile(.xsd)totheworkbook,
andthenusetheXMLSourcetaskpanetomapXMLelementsoftheschematoindividualcells
ortables.AfteryoumaptheXMLelementstoyourworksheet,youcanimportandexportXML
data into and out of the mapped cells. When you add an XML schema file (.xsd) to your
workbook,youcreateanXMLmap.Ingeneral,XMLmapsareusedtocreatemappedcellsand
tomanagetherelationshipbetweenmappedcellsandindividualelementsintheXMLschema.
Inaddition,theseXMLmapsareusedtobindthecontentsofmappedcellstoelementsinthe
schemawhenyouimportorexportXMLdatafiles(.xml).
Therearetwokindsofmappedcellsthatyoucancreate:singlemappedcellsandrepeatingcells
(which appear as XML tables). To make designing your worksheet more flexible, you can drag
themappedcellsanywhereonaworksheetandintoanyorderevenonedifferentfromthe
XMLschema.Youcanalsochoosewhichelementstomapandnotmap.
ThefollowingrulesaboutusingXMLmapsareimportanttoknow:
1. AworkbookcancontainoneormoreXMLmaps.
2. Youcanonlymaponeelementtoonelocationinaworkbookatatime.
3. Each XML map is an independent entity, even if multiple XML maps in the same
workbookrefertothesameschema.
4. AnXMLmapcanonlycontainonerootelement.Ifyouaddaschemathatdefinesmore
than one root element, you are prompted to choose the root element to use for the
newXMLmap.
UsingtheXMLSourcetaskpane
YouusetheXMLSourcetaskpanetomanageXMLmaps.Toopenit,ontheDevelopertab,in
theXMLgroup,clickSource.Thefollowingdiagramshowsthemainfeaturesofthistaskpane.
Page131
1. ListsXMLmapsthatwereaddedtotheworkbook
2. DisplaysahierarchicallistofXMLelementsinthecurrentlylistedXMLmap
3. SetsoptionswhenworkingwiththeXMLSourcetaskpaneandtheXMLdata,suchas
howtopreviewthedataandcontrolheadings
4. Opens the XML Maps dialog box, which you can use to add, delete, or rename XML
maps
5. VerifieswhetheryoucanexportXMLdatathroughthecurrentXMLmap
Elementtypesandtheiricons
ThefollowingtablesummarizeseachtypeofXMLelementthatExcelcanworkwithandtheicon
thatisusedtorepresenteachtypeofelement.
Elementtype
Icon
Parentelement
Requiredparentelement
Repeatingparentelement
Requiredrepeatingparentelement
Childelement
Requiredchildelement
Repeatingchildelement
Requiredrepeatingchildelement
Attribute
Requiredattribute
Simplecontentinacomplexstructure
Requiredsimplecontentinacomplexstructure
Workingwithsinglemappedcells
AsinglemappedcellisacellthathasbeenmappedtoanonrepeatingXMLelement.Youcreate
asinglemappedcellbydragginganonrepeatingXMLelementfromtheXMLSourcetaskpane
onto a single cell in your worksheet. When you drag a nonrepeating XML element onto the
worksheet,youcanuseasmarttagtochoosetoincludetheXMLelementnameasaheading
above or just to the left of the singlemapped cell, or you can use an existing cell value as a
heading. You can also use a formula in a singlemapped cell, if the cell is mapped to an XML
elementwithanXMLSchemaDefinition(XSD)datatypethatExcelinterpretsasanumber,date,
ortime.
WorkingwithrepeatingcellsinXMLtables
Page132
XMLtablesaresimilarinappearanceandfunctionalitytoExceltables.AnXMLtableisanExcel
tablethathasbeenmappedtooneormoreXMLrepeatingelements.EachcolumnintheXML
tablerepresentsanXMLelement.AnXMLtableiscreatedwhenyou:
1. UsetheImportcommand(intheXMLgroupontheDevelopertab)toimportanXML
datafile.
2. UsetheOpencommand(ontheMicrosoftOfficeButton)toopenanXMLdatafile
andthenselectAsanXMLtableintheOpenXMLdialogbox.
3. Use the From XML Data Import command (from the From Other Sources command
button,intheGetExternalDatagroup,ontheDatatab)toimportanXMLdatafile
andthenselectXMLtableinexistingworksheetorNewworksheetintheImportData
dialogbox.
4. DragoneormorerepeatingelementsfromtheXMLSourcetaskpanetoaworksheet.
5. When you create an XML table, the XML element names are automatically used as
column headings. You can change these to any column headings that you want.
However,theoriginalXMLelementnamesarealwaysusedwhenyouexportdatafrom
themappedcells.
TwooptionsundertheOptionsbuttonintheXMLSourcetaskpaneareusefulwhenyouwork
withXMLtables:
1. AutomaticallyMergeElementsWhenMappingWhenselected,ExcelcreatesoneXML
tablefrommultiplefieldsastheyaredroppedontotheworksheet.Thisoptionworksas
long as the multiple fields are dropped on the same row, one adjacent to the other.
Whenthisoptioniscleared,eachelementappearsasitsownXMLtable.
2. My Data Has HeadingsWhen selected, existing heading data is used as column
headingsforrepeatingelementsthatyoumaptoyourworksheet.Whenthisoptionis
cleared,theXMLelementnamesareusedascolumnheadings.
UsingXMLtables,youcaneasilyimport,export,sort,filter,andprintdatabasedonanXMLdata
source.However,XMLtablesdohavesomelimitationsregardinghowtheycanbearrangedon
theworksheet.
XMLtablesarerowbased,meaningthattheygrowfromtheheaderrowdown.Youcannotadd
newentriesaboveexistingrows.YoucannottransposeanXMLtablesothatnewentrieswillbe
addedtotheright.YoucanuseformulasincolumnsthataremappedtoXMLelementswithan
XMLSchemaDefinition(XSD)datatypethatExcelinterpretsasanumber,date,ortime.Justas
in an Excel table, formulas in an XML table are filled down the column when new rows are
addedtothetable.
XMLmapsecurityconsiderations
AnXMLmapanditsdatasourceinformationaresavedwiththeExcelworkbook,notaspecific
worksheet.AmalicioususercanviewthismapinformationbyusingaMicrosoftVisualBasicfor
Applications (VBA) macro. Furthermore, if you save your workbook as a macroenabled Excel
Open XML Format File, this map information can be viewed through Microsoft Notepad or
throughanothertexteditingprogram.
Ifyouwanttokeepusingthemapinformationbutremovethepotentiallysensitivedatasource
information,youcandeletethedatasourcedefinitionoftheXMLschemafromtheworkbook,
Page133
butstillexporttheXMLdata,byclearingtheSavedatasourcedefinitioninworkbookcheckbox
intheXMLMapPropertiesdialogbox,whichisavailablefromtheMapPropertiescommandin
theXMLgroupontheDevelopertab.
Ifyoudeleteaworksheetbeforeyoudeleteamap,themapinformationaboutthedatasources,
andpossiblyothersensitiveinformation,isstillsavedintheworkbook.Ifyouareupdatingthe
workbooktoremovesensitiveinformation,makesurethatyoudeletetheXMLmapbeforeyou
deletetheworksheet,sothatthemapinformationispermanentlyremovedfromtheworkbook.
ImportingXMLdata
YoucanimportXMLdataintoanexistingXMLmapinyourworkbook.Whenyouimportdata,
youbindthedatafromthefiletoanXMLmapthatisstoredinyourworkbook.Thismeansthat
eachdataelementintheXMLdatafilehasacorrespondingelement,intheXMLschema,that
you mapped from an XML Schema file or inferred schema. Each XML map can only have one
XMLdatabinding,andanXMLdatabindingisboundtoallofthemappingsthatwerecreated
from a single XML map. You can display the XML Map Properties dialog box (Click Map
Properties in the XML group on the Developer tab.), which has three options, all selected by
default,thatyoucansetorcleartocontrolthebehaviorofanXMLdatabinding:
1. ValidatedataagainstschemaforimportandexportSpecifieswhetherExcelvalidates
data against the XML map when importing data. Click this option when you want to
ensurethattheXMLdatathatyouimportconformstotheXMLschema.
2. OverwriteexistingdatawithnewdataSpecifieswhetherdataisoverwrittenwhenyou
importdata.Clickthisoptionwhenyouwanttoreplacethecurrentdatawithnewdata,
forexample,whenuptodatedataiscontainedinthenewXMLdatafile.
3. Append new data to existing XML tablesSpecifies whether the contents of the data
source are appended to the existing data on the worksheet. Click this option, for
example, when you are consolidating data from several similar XML data files into an
XML table, or you do not want to overwrite the contents of a cell that contains a
function.
WhenyouimportXMLdata,youmaywanttooverwritesomemappedcellsbutnotothers.For
example,somemappedcellsmaycontainformulasandyoudon'twanttooverwritetheformula
whenyouimportanXMLfile.Therearetwoapproachesthatyoucantake:
1. Unmaptheelementsthatyoudon'twantoverwritten,beforeyouimporttheXMLdata.
AfteryouimporttheXMLdata,youcanremaptheXMLelementtothecellscontaining
theformulas,sothatyoucanexporttheresultsoftheformulastotheXMLdatafile.
2. CreatetwoXMLmapsfromthesameXMLschema.UseoneXMLmapforimportingthe
XML data. In this "Import" XML map, don't map elements to the cells that contain
formulas or other data that you don't want overwritten. Use another XML map for
exportingthedata.Inthis"Export"XMLmap,maptheelementsthatyouwanttoexport
toanXMLfile.
TheabilitytoimportXMLdatafromaWebservicebyusingaDataRetrievalServiceConnection
(.uxdc) file to connect to a data source is no longer supported in Microsoft Office Excel 2007
Page134
throughtheuserinterface.IfyouopenaworkbookthatwascreatedinOfficeExcel2003,you
canstillviewthedata,butyoucannoteditorrefreshthesourcedata.
Workingwithaninferredschema
IfyouimportXMLdatawithoutfirstaddingacorrespondingXMLschematocreateanXMLmap,
ExceltriestoinferaschemaforyoubasedonthetagsthataredefinedintheXMLdatafile.The
inferredschemaisstoredwiththeworkbook,andtheinferredschemaallowsyoutoworkwith
XML data if an XML schema file isn't associated with the workbook. When you work with
importedXMLdatathathasaninferredschema,youcanalsocustomizetheXMLSourcetask
pane.SelectthePreviewDatainTaskPaneoptionfromtheOptionsbuttontodisplaythefirst
row of data as sample data in the element list, if you imported XML data associated with the
XMLmapinthecurrentsessionofExcel.
You cannot export the Excel inferred schema as a separate XML schema data file (.xsd).
AlthoughthereareXMLschemaeditorsandothermethodsforcreatinganXMLschemafile,you
maynothaveconvenientaccesstothemorknowhowtousethem.Asanalternative,youcan
usetheExcel2003XMLToolsAddinVersion1.1,whichcancreateaschemafilefromanXML
map.Formoreinformation,seeUsingtheExcel2003XMLToolsAddinVersion1.1.
ExportingXMLdata
YouexportXMLdatabyexporting the contentsofmapped cellsontheworksheet.When you
exportdata,Excelappliesthefollowingrulestodeterminewhatdatatosaveandhowtosaveit:
1. Emptyitemsarenotcreatedwhenblankcellsexistforanoptionalelement,butempty
itemsarecreatedwhenblankcellsexistforarequiredelement.
2. UnicodeTransformationFormat8(UTF8)encodingisusedtowritethedata.
3. AllnamespacesaredefinedintheRootXMLelement.
4. Excel overwrites existing namespace prefixes. The default namespace is assigned a
prefix of ns0. Successive namespaces are designated ns1, ns2 to ns<count> where
<count>isthenumberofnamespaceswrittentotheXMLfile.
5. Commentnodesarenotpreserved.
6. YoucandisplaytheXMLMapPropertiesdialogbox(ClickMap PropertiesintheXML
groupontheDevelopertab.)andthenusetheValidatedataagainstschemaforimport
andexportoption(activebydefault)tospecifywhetherExcelvalidatesdataagainstthe
XMLmapwhenexportingdata.ClickthisoptionwhenyouwanttoensurethattheXML
datayouexportconformstotheXMLschema.
UsingtheExcelMacroenabledOfficeXMLFormatFile
YoucansaveanExcelworkbookinavarietyoffileformats,includingtheExcelmacroenabled
OfficeXMLFormatFile(.xlsm).ExcelhasadefinedXMLschemathatdefinesthecontentsofan
Excel workbook, including XML tags that store all workbook information, such as data and
properties,anddefinetheoverallstructureoftheworkbook.Customapplicationscanusethis
Excel macroenabled Office XML Format File. For example, developers may want to create a
custom application to search for data in multiple workbooks that are saved in the this format
andcreateareportingsystembasedonthedatafound.
Page135
Chapter12
UsingMicrosoftExcel
withYourAccounting
System
FeaturingExamplesusingDynamicsGP
Page136
ChapterContentsandlearningPoints
UsingExcelwithYourAccountingSystem.............................................................................
AccountingSystemUsedinDemonstrations.........................................................................
ExecutiveSummaryofDynamicsGP.....................................................................................
ExportingFinancialReportstoMicrosoftExcel.....................................................................
WhatifAnalysis.....................................................................................................................
DataAnalysis..........................................................................................................................
AutomatingtheTaskofExportingData.................................................................................
ObjectLinkingandEmbedding(ODBC).................................................................................
1. SimplePortfolioExample.....................................................................................
2. AccountingSystemExampleConnectingtoDynamicsGP...............................
AnalyzingInventoryinExcel..................................................................................................
BusinessAlerts.......................................................................................................................
CreatingBudgetsinExcelusingLinearRegressionAnalysis..................................................
OtherAccountingSystemtoExcelFunctionality...................................................................
CarltonsTenFavoriteThingsaboutDynamicsGP................................................................
1. MoreFeatures.....................................................................................................
2. StrongDatabase...................................................................................................
3. BreadthofModules.............................................................................................
4. StrongFinancialReporting...................................................................................
5. EndUserCustomizationTools.............................................................................
6. InterCompanyAccounts.....................................................................................
7. ForwardLookingReports.....................................................................................
8. OfficeIntegration.................................................................................................
9. NetworkArchitecture..........................................................................................
10. WebBrowserAccess............................................................................................
AbouttheAuthor&ContactInformation.............................................................................
Page137
UsingExcelwithYourAccountingSystem
Theprimarygoalofanaccountingsystemistoproducefinancialstatementsandreports
tohelpcompanyofficialsmanagethebusiness.Unfortunatelymanyaccountingsystems
fallshortofprovidingthefinancialinformationneededtoaccomplishthisgoal.Inthis
situation,Microsoftexcelcanoftenfillthisvoid.MicrosoftExcelcanbeusedtoanalyze
andmanipulatedatafromyouraccountingsysteminmanydifferentways.Thischapter
explores a multitude of ways in which this can be accomplished providing realtolife
examplesasfollows:
1. ExportingfinancialreportstoMicrosoftExcel.
2. PreparingfinancialprojectionsinMicrosoftExcelusinglinearregressionanalysis.
3. PivotingaccountingsystemdatainMicrosoftExcel.
4. ProducingvisualchartsandgraphsusingaccountingdatainMicrosoftExcel.
5. ExportingaccountingsystemtransactiondatatoMicrosoftExcel.
6. ExportingaccountingsystemmasterfiledatatoMicrosoftExcel.
7. PerformingRatioAnalysisusingMicrosoftExcel.
8. GeneratingOLAPdatacubes.
9. HotlinkingdatafromyouraccountingtoExcelusingODBCintegration.
10. PreparingaccountingsystembudgetsinMicrosoftExcel.
11. AdjustingandmanaginginventorypricesusingMicrosoftExcel.
12. ImportingaccountingtransactionsfromMicrosoftExcel.
13. MaintainingmasterfiledatausingMicrosoftExcel.
14. Using Excel to mail merge contact information and data from your accounting
system.
AccountingSystemUsedinDemonstrations
Forpurposesofdemonstratingtheseconcepts,wewillusetheMicrosoftDynamicsGP
accountingsystem.
Page138
ExecutiveSummaryofDynamicsGP
1. TopRatedDynamicsGPisregardedasoneoftheworldstopsolutions.
Financial
Management
ProjectManagement
SupplyChain
Management
BusinessIntelligenceand
Reporting
CustomerRelationship
Management
CollaborativeWorkspace
HumanResource
Management
Manufacturing
Configurationand
Development
3. ModulesDynamicsGPhasmorethan50modulesand200addinsolutions.
4. Customers More than 100,000 companies in more than 50 countries use the
MicrosoftDynamicssolutions.
5. PartnersTherearemorethan5,200PartnerssellingandsupportingMicrosoft
DynamicssolutionsintheUS,andmorethan9,900worldwide.
Page139
6. FamiliarDesignMicrosoftDynamicssolutionsuseamenudesignandinterface
thatissimilartothatfoundinMicrosoftOfficeSuiteofproductswhichmeans
youareprobablyalreadyfamiliarwiththeDynamicsproducts.
Formoreinformationvisit:www.asmartmove.com
Page140
ExportingFinancialReportstoMicrosoftExcel
MostaccountingsystemsprovidetheabilitytoexportfinancialstatementstoMicrosoft
Excelforawidevarietyofreasonsincluding:
1. Whatifanalysis.
2. Dataanalysis.
3. Charting.
4. Consolidatingdatafromotherreports.
5. Consolidatingdatafromotheraccountingsystems.
6. BudgetPreparation.
7. Simplytobetterformatthereportbeforeprinting.
Theseexamplesarediscussedinmoredetailbelow:
WhatifAnalysis
Excelisagreattoolforusingwhatifanalysistostudythepotentialimpactofchanging
variables. There are a wide variety of methods and tools for preparing a Whatif
analysisinExcel.Tostarttheprocess,weexportourfinancialreportsfromDynamicsGP
into Excel. As with most top accounting systems, Dynamics GP provides an Excel (and
Word)exportbuttonatthetopofallfinancialstatementsandreportstomakeiteasyto
sendreportsanddatatoExcel.
TheFinancialReportsListinDynamicsGPincludesmorethan1,950standardreportsaswellas
Import/ExportandExcelReportbuttonstoinstantlysendthosereportstoMicrosoftExcel.
Once the report is in Excel, simply plug new numbers or write simple formulas to
increase or decrease financial statement line items. Better yet, use Excels Whatif
Analysistoolslocatedonthedatamenutomanipulatethedata.Forexample,youmight
Page141
usetheGoalSeektooltodeterminethenecessarygrossprofitmarginforproducinga
$1,000,000profit.YoumightusetheDataTabletooltoproduceatableofresulting
gross profit and net income amounts based on a variety of changing gross profit
percentages. As you create new financial reports, you can save each new result using
theScenarioManagertoolforlaterretrievalandcomparison.
ExcelsWhatifAnalysistoolshelpyouanalyzetheaffect
ofchangingassumptionsandvariables,andcapturethoseresults.
DataAnalysis
Data analysis differs from whatif analysis in that you are seeking to better under
yourdata,ratherthanspeculatingontheresultsofdifferentdata.Excelhasmanytools
designedtohelpusersanalyzedataasshowninthefollowingexample.Inthisexample
wewillexportdatafromDynamicsGPusingthebuiltinSmartListtoolandanalyzethe
datainavarietyofwaysinExcel.
TheDynamicsGPSmartListtoolprovidesawindowintoallofthedatacontainedinDynamicsGP.There
areseveralhundredstandardlists,andadditionallistscanbecustomcreated.
TheDynamicsGPSmartListprovidesauniqueapproachtoaccessingdataitssortof
likeholdingupapairofbinocularsandlookingdirectlyintothedatabasetableswithin
DynamicsGP.UsetheChangeColumnDisplaydialogbox toindicatewhichdatafields
aretoappearinthereport.Onceyouhavemodifiedthereporttoyoursatisfaction,you
cancreateaFavoriteslinktothatreportsothatyoudonthavetorecreatethatsame
reportfromscratchagaininthefuture.
Page142
TheDynamicsGPSmartListprovidesaccesstoalldataintheDynamicsGPdatabasetables.Asshown
above,additionalfieldscanbeaddedtothereports,andfilterscanbeappliedtoproducespecificresults.
Additional SmartList features allow you to link to Microsoft Dynamics GP data from
Office applications, using smart tags to speed access to customer, vendor, inventory,
general ledger account, and employee information. For example, using the SmartList
Builder,youcanlinkdatafromMicrosoftDynamicGPtocreateacustomizedlistofthe
information you want to review and analyze; then easily export inquiries to Word or
Microsoft Office Excel for use in mass mailings or further analysis. You can view a
completelistingofallstandardSmartListreportshere:
http://www.microsoft.com/dynamics/gp/using/defaultsmartlistfavorites.mspx.
SimplyclicktheExcelexporttoollocatedatthetopoftheSmartListtosendthedatato
Excel.
The resulting data is exported to Excel as shown below. The Dynamcis GP SmartList
exportworkswellwithExcel2007orpreviousversionsofExcelifthatiswhatisloaded
onyourcomputer.
Page143
CustomerdataexportedfromDynamicsGPtoExcelusingtheSmartListtool
InExceladditionalformulascanbeaddedeasilyfordataanalysispurposes.Forexample
in the screen below two columns have been added to calculate the profit and profit
percentages.
FormulasareaddedtodataexportedfromDynamicsGPtocalculateprofitandprofitpercentages.
NoticealsothatIFfunctionshavebeeninsertedintotheprofitpercentageformulasto
preventDividebyZeroerrorsfrombeingdisplayedwherelineitemsareempty.The
nextstepistodressuptheappearanceofthedatabywrappingandcenteringthetitles
and adjusting the column widths so more data fits on the visible screen. Bolded fonts
Page144
havealsobeenappliedandthezoomhasbeenincreasedtoincreasethereadabilityof
thedata.
CustomerinformationdisplayedinExcelafterenhancingtheappearanceofthedata.
ThenextstepinanalyzingthisdatamightbetoapplytheExcelAutoFiltertoollocated
onthedatamenu.Thefiltertoolenablesyoutoinstantlycondenseyourdatabasedon
thecontentsofanycolumn.
ExcelsAutoFiltertoolisusedtodisplayinformationfortheEASTregionofthecountryonly.
You should always use the Subtotaling tool in conjunction with the AutoFilter tool so
that filtered data will automatically display subtotals. To use the subtotaling tool, first
sort the data by the column you are interested in using to group your data. In this
Page145
examplewehavepresortedthedatabythecolumnlabeledSalespersonID.Nextturn
onthesubtotalingtool(whichislocatedontheDataRibbon)andindicatethecolumns
you want summed. For example, in the screen below you can see subtotals for both
WrightandSandra.Nowwhenyoufilterdata,yourfilteredresultswillbeautomatically
summedaswell.
ExcelsSubtotalingToolisusedtocreateautomaticsubtotalswhichalsorespondtodatafiltering.
Ifdesired,youcouldalsouseExcel2007snewTabletooltoconvertthedatarangeto
an Excel Table. This task is performed by selecting Insert Table from the Data
Ribbon. Thereafter Excel will display a multitude of tools such as gallery formatting,
bandedrows,outlining,etc.
TheTableToolsinExcel2007makeiteasiertoformatandmanagelargeblocksofdata.
Page146
PerhapsthebestwaytoanalyzeaccountingsystemdatainExcelistousePivotTablesto
create views of your data that can be easily pivoted, drilled, and filtered. To create a
PivotTable simply place your cursor in any cell within the transaction data exported
from Dynamics GP, and select Insert PivotTable from the Data Ribbon. This process
willgenerateablankPivotPaletteliketheoneshownbelow.
ABlankPivotTablepaletteinExcel2007
To complete a PivotTable Report simply drag and drop the field names shown in the
PivotTable Field List at the right of the screen onto the appropriate spot on the Pivot
Palette.Forexample,ifyoudropthecustomernamefieldalongthetopofthereport,
thenExcelwilldisplaycustomernamesacrossthetop.Ifyoudropthecustomername
fieldalongtheleftsideofthereport,thenExcelwilldisplaycustomernamesdownthe
page(asshownbelow).
ThisPivotTablereportwascreatedinExcelfromDataExportedfromDynamicsGP.
Page147
The next step might be to filter the data to display only those line items that show a
balance in the Balance Due column. Perform this task by right clicking on the
CustomerNametitleinthePivotTableandchooseFilterByValuestocreateafilter
rule to display only those line items where the balance due is greater than zero. This
data can then be sorted by any column simply by placing the cursor in the desired
columnandchoosingSortAtoZorSortZtoAfromtheDataRibbon.
APivotTableReportwhichhasbeenfilteredtosuppressdisplayoflineitemswithazerobalance.
You might further filter the PivotTable Report to display selected data by column. For
example,inthescreenbelowwehavefilteredbysalespersonIDtodisplaythedatafor
Greg,Nancy,PaulandSandraonly.
PivotTableReportfilteredfurtherbyColumntodisplaydataonlyselectedSalespersons.
Page148
As seen in the example above, a PivotTable can be created quickly and easily to
condense large volumes of data down into small reports that are easy to read and
understand. In this case a CFO might want to analyze the current balances due of
customersfrom4differentsalespersonsforpurposesofdeterminingwhichsalesperson
toletgoorperhapstodeterminewhichsalespersonismostworthyofapromotion.
ThedataextractedfromDynamicsGPcouldbeusedtoproducenumerousPivotTable
reportsalltiedtothesamerawdata.InourexampleonlyonePivotTableReportwas
created,butdozensofadditionalPivotTableReportscouldbeaddedusingthesameraw
data.
OnceaPivotTablehasbeencreated,youcandoubleclickonanynumberinaPivotTable
to drill down into the underlying data beneath that number. The screens below show
how double clicking on the $3,939.264 outstanding AR balance for Nancy drills to a
complete listing of all AR balances for Nancy. This Drillability enhances the users
abilitytofollow,studyandbetterunderstandtheunderlyingdatabehindallPivotTable
amounts.
DoubleclickinganynumberinaPivotTableReportinstantlygeneratesasupportingschedule.
Page149
Asshowninthescreenabove,Excel2007sTableToolsmakeiteasytoinsertformulas
beloweachcolumnofnumbers.
ExcelprovidesanotherusefuldatatoolinPivotCharts,whichworksimilartoPivotTables
to produce a wide variety of charts that are linked to the raw data. For example,
presented below is the resulting chart that appears by inserting a new PivotChart in
ExcelfromtheworksheetcontainingtherawdataexportedfromDynamicsGP.
APivotChartProducedinExcel2007fromdataExportedfromDynamicsGP.
Fromhere,youcouldchooseadifferentcharttype,suchasanexploded3Dimensional
Pie chart from the Change ChartType dialog box. You could also use the PivotChart
DesignToolstoselectapredefinedchartlayoutusingtheChartGalleryshownbelow.
ExampleExploded3DimensionalPiePivotChart
Page150
Additionalchartingtoolscanbeusedtoaddalegend,title,rotation,orevendatalabels
asshownbelow.
DataLabelsareaddedtoanExploded3DimensionalPiePivotChart.
InthisnextscreenweseethesamechartshownabovehasbeentransformedintoaBar
Chart with Beveled Top, Orange Walls, and the picture of each sales rep has been
insertedineachindividualbar.
Page151
AutomatingtheTaskofExportingData
Of course the idea of export and manipulating data each day, week, month quarter or year does not
appealtomostCPAsbecausethereisusuallysomuchlaborinvolvedinthewholeprocess.Howeverthis
isnotthecasewithsomeaccountingsystems.InDynamicsGPthereareseveralmethodsforextracting
thesamedataeachday,week,month,quarteroryearwithasimpleclickofabuttonandtheresulting
data is sent to Excel where the PivotTables, PivotCharts, and reports you have already created are
instantlylinkedtothenewdata,orarelinkedtothenewdataviaasimplecopypasteprocedure.Listed
below are five different approaches for automating the task of sending data to Excel from within
DynamicsGP;eachmethodhasmerit.
1.
2.
3.
4.
5.
DynamicsGPSmartListBuilderandExportSolution.
DynamicsGPMacroRecorder.
ExcelODBCDriverforDynamicsGP.
ExcelOLAPDataCubing.
DynamicsGPDashboardReporting.
Asanexample,theDynamicsGPSmartListBuilderandExportSolutionscreenisshownbelow.Thisdialog
box can be used to create data queries which are automatically generated in Dynamics GP and sent to
Excel merely by clicking on the icon shown in the Export Box below. As you can see in the Document
Fieldbelow,thisexportisalreadylinkedtotheappropriateExcelworkbook,andasimpledoubleclickin
DynamicsGPupdatestheworkbookwithfreshdata.
TheDynamicsGPExportSolutionDialogBoxhelpsAutomatetheTaskofSendingDatatoExcel
Another option for sending data to Excel is the Dynamics GP Macro Recorder which
works just like the macro recorder in Microsoft Excel. Simply select Record a Macro
fromtheDynamicsGPmenu,provideanameforthemacro,andthenexportyourdata.
When you are done exporting your data, simply select Stop Recording from the
DynamicsGPmenuandthemacroiscompleted.Nexttime,simplyrunthemacroand
Page152
Dynamicswillreplicateallofyourkeystrokesinaninstant,generatingallrelevantdata
andsendingthatdataouttoanExcelformat.OncethedataappearsinanExcelformat,
youneedonlyopenthatnewworkbook,copytheentireworksheetofdataandpaste
intotherawdatapageofyourworkbookcontainingyourPivotTables,PivotChartsand
formulabasedreports.Becausethefieldnameswillalwaysbethesame,yourreports
will be instantly updated to reflect the new data. If this copy and paste approach still
seemsliketoomuchwork,youcanalsoinstructDynamicsGPtosendthedatadirectly
tothedesiredworkbookasshownintheexampleonthepreviouspage.
The following screens show how to create an export macro in Dynamics GP. Start by
selecting Tools, Macro, Record from the Microsoft Dynamics GP menu. In the
Name themacro dialog box, create a namefor the macro that willmake it easy for
youtoidentifylater.
CreatingaMacroinDynamicsGPTheMacroMenuOptionsandNametheMacroDialogBox
Next export all of the data that you intend to export using the standard export procedures you prefer.
When completed, select Tools, Macro, Stop Recording from the Microsoft Dynamics
GP menu. Next time you want to repeat the export process, simply run this newly
createdmacro,andtheexportprocesswillbeperformedforyou.
Similarresultscanbeachievedwithoutusingthemacro,butbyinsteadcreatingaPivotReport.Todothis
select Tools, Setup, Analysis Cube, Pivot Report Creation Setup Options from the Microsoft
DynamicsGPmenuasshownbelow.ThisoptionwilllaunchtheCreatePivotTabledialog
box shown below. Select the data you want to appear in the resulting PivotTable and
save the results. In the future you can simply run this PivotTable tool which will send
updatedinformationtoExcelintheformofaPivotTableautomatically.
Page153
ObjectLinkingandEmbedding(ODBC)
AnotherapproachfortyingaccountingsystemdatatoExcelisthroughtheuseofODBC
drivers to establish a permanent connection to external data that can be reretrieved
with the click of the Refresh button. This approach prevents the need to repeatedly
copyandprocessthedataanoperationthatcanbetimeconsuminganderrorprone.
The connection information for an ODBC link can be stored in the workbook, in a
connectionfile(suchasanOfficeDataConnection(ODC)file(.odc)),oraDataSource
Namefile(.dsn).InourexamplewewillcreateaconnectionfromExceltoDynamicsGP
bysavingtheconnectioninformationintheExcelworkbook.
SimplePortfolioExample
Tohelpyouunderstandtheconcept,letsstartwiththefollowingsimplestockportfolio
example.Excelincludesapredesignedquerythatcanretrievethecurrentstockprice
foranystock,fundorotherinvestmentwithatickersymbol.TocreateanODBClinkto
stockquotes,youwillneedaconnectiontotheinternetandsomestocktickersymbols.
In Excel 2007 select Existing Connections from the Get External Data tool on the
DataRibbonasshowninthescreenbelow.
Page154
The Existing Connections dialog box will appear. Doubleclick the option for MSN
MoneyCentralInvestorStockQuotesasshownbelow.
NexttheImportDatawizard(shownbelow)willappeartowalkyouthroughthedata
connectionprocess.ClickOKinthefirstdialogboxandintheseconddialogboxenter
thetickersymbolsyouareinterestedinseparatedbycommas,andchecktheboxtitled
usethisvalueforfuturerefreshes.HereIhaveenteredtickersymbolsforMicrosoft,
CocaCola,Google,IntelandAppleComputers.
PressOKtocompletethedataconnection.Thefollowinginformationwillbedisplayed
inExcel.
Page155
Each time you refresh the data (circled above), new stock data will be instantly
retrieved. These amounts can then be referenced in a stock portfolio report including
thenumberofsharesofstockandformulastocalculatetheinvestmentvalues.Asthe
rawdataisrefreshed,thetotalvalueoftheportfoliowillbeupdated.Forexamplenote
thetwoscreensbelow.
Inthetimeittookmetopastethefirstportfolioabove,theportfoliohadincreaseda
totalof$12,600asshowninthesecondscreen.BythetimeIwrotethissentence,the
portfolio had increased another $7,850. The point is that now I can see my total
portfoliovaluesimplybyclickingtherefreshbutton.
AccountingSystemExampleConnectingtoDynamicsGP
Letusnowtakethisexamplefurtherbyconnectingtoanaccountingsystemdatabase
ratherthanadatabaseofstockvalues.Thedifferenceisthatwewillneedtobrowseto
thedatabaseanddigthroughthevarioustablesinordertoidentifythedatafieldsthat
we want displayed in our query. These extra steps make accounting system queries a
little more difficult to create, but once they are created, all it takes is a click of the
refresh button to retrieve new accounting data. The following example will walk you
throughtheprocessstepbystep.
Note:touseMicrosoftQuerytoretrieveexternaldata,youmust:
Page156
4.
5.
6.
Haveaccess(permissions)toanexternaldatasourceIfthedataisnotonyourlocalcomputer,you
mayneedtoseetheadministratoroftheexternaldatabaseforapassword,userpermission,orother
informationabouthowtoconnecttothedatabase.
InstallMicrosoftQueryIfMicrosoftQueryisnotavailable,youmightneedtoinstallit.
Specifyasourcetoretrievedatafrom,andthenstartusingMicrosoftQueryForexample,ifyou
want to insert database information, display the Database toolbar, click Insert Database, click Get
Data,andthenclickMSQuery.
ContinuebyselectingFromMicrosoftQueryfromtheFromOtherSourcesoptionin
theGetExternalDatachunkontheDataRibbonasshownbelow.
Excelwilldisplayalistofdatabasesthatitseesautomatically.(Ifthedatabaseyouwant
to query is located on a another computer file server, then you will need to click the
Browse button and browse to the actual database.) In the example below, Excel
automaticallyseesDynamicsGPisloadedonthecomputer.
Page157
Select the Dynamics GP option and login to the database as shown below. Note that
ODBC connections and web queries obey all database permissions; therefore a
passwordistypicallyneededtocreatethistypeofconnection.
Uponloggingin,theExcelQuerywizardwilldisplayalistoftablenames.Scrollthrough
the list andfind the table that contains the data you want. This is usually the hardest
partoftheprocessbecauseitcanbedifficulttoknowexactlywhichtablecontainsthe
datayouareafter.Howeverwithalittlebitofeffort,trialanderrorsearch,andperhaps
asenseofhumor,eventuallyyouwillfinddatayouareafter.
Page158
InthisexampleIhavescrolledtotheCustomerTableandIhaveselectedtheseveral
datafieldnamesfromthistablebyclickingthegreaterthansignlocatedinthemiddleof
thedialogbox.ThisprocessshovesthedatafieldsfromtheAvailableDataFieldsList
onthelefttotheColumnsinYourQuerylistontheright.Thisishowyouselectthe
particulardatatobeextractedfromtheaccountingsystem.Theresultswillappearas
follows:
If desired, the Query Wizard will provide you with options to filter and sort the data
beforeretrievingitintoExcel.Asexamples,thetwodialogboxesshownbelowdepicta
filtertoreturnonlycustomerinformationforcustomersinCaliforniaandtheresulting
datawillbesortedbybalancedueindescendingorder.
At the end of the Query Wizard you will have the option to display the data in Excel,
viewthedataviaaquerywindow,orsavethequeryforfutureuse.ClickingFinishwill
provideadditionaloptionsfordisplayingthedataasaTable,PivotTable,orPivotChart.
Theseoptionsareshownbelow:
Page159
NoticealsothataPropertiesbuttonontheimportdatadialogboxprovidesafewother
options which will probably be of interest. These options include OLAP drilling, time
elapsedrefreshes,andmostimportanttheabilitytosavethepasswordnecessaryto
refresh the query in the future without reentering the password each time. These
additionaloptionsareshownbelow.
Clicking the OK button completes the query and the resulting Dynamics GP data is
displayedinExcelasshownbelow.
Page160
InthefutureyouneedonlyclicktheRefreshbuttontoretrieveupdatedinformation
fromDynamicsGP.
NowthattherawdatahasbeenretrievedfromDynamicsGPanddisplayedinExcel,all
of Excels power can then be used to manipulate and analyze the data. As examples,
noticethatthedataisreadytopivot.WecancreateaPivotTableeasilybyplacingour
cursorinanycelloftherawdatarange,andselectingPivotTablefromtheInsertRibbon
asshownbelow.
ThisprocesscreatesablankPivotTablepaletteliketheoneshownbelow.(Iveenabled
the Classic PivotTable view in Excel 2007 by right clicking the palette and clicking the
ClassicPivotTableLayoutoptionundertheDisplaytabonthePivotTableOptionsbox.)
Page161
Because some customer balances and salesperson balances are zero, I apply a Value
Filtertoshowonlythosecustomersandsalespersonswithactualamountsdue(thatis
amounts greater thanZero). I apply the sametype of filter to the salesperson field as
well.
Page162
The result provides a detailed listing of all customer balances due stratified by sales
person. The report fits nicely on my screen and at anytime that I click the Refresh All
button,thisreportwillbeinstantlyupdated,asshownbelow:
SimilarprocedurescouldbeusedtocreatePivotChartsliketheoneshownbelow.For
example,inthisPivotChartIcanseetheTotalCustomerBalancesDuebyState.
Page163
AnalyzingInventoryinExcel
Asanotherexample,letusapplythesameODBCtechniquesdescribedabovetoanalyze
inventory.InthiscasewebrowsetotheInventoryItemMasterTableandretrievethe
followinginformation:
Page164
In total, this action retrieves inventory data for 5,399 items in Dynamics GP, and the
whole process from beginning to end takes only 20 seconds. In this example, I have
added an additional two columns to calculate the Profit Margin and Profit Margin
PercentageforeachinventoryitemincolumnsIandJ.Thisenablesmetosortthe
data by profit margin to identify those items that are priced below the desired profit
margin.IcanfurtherapplyavaluefiltertocolumnJtodisplayonlythoseitemswith
profit margins below a set percentage. This information can used to identify any item
pricedsubstantiallylowerthanthedesiredprofitmarginforcorrectionpurposes.
Thisprocedureshouldbeperformedbyanycompanywhohandlesinventory.Consider
thefollowingcasestudy:
Stephaniehasownedandoperatedafurniturestoreforthepast17years.
Iaskhertwoquestionsasfollows:
1. Howmuchprofitdoyouwanttomakenextyear,and
2. Howmuchsalesdoyouanticipatenextyear?
Stephanierespondsthatseasy,wevebeengrowingat8%ayearfor
the past five years so we will probably hit $12 million in revenue next
Page165
Page166
TheItempriceListMaintenanceScreeninDynamicsGPprovidesnumerouspricingoptions.
As you can see above, we have set the gross margin for this Digital Cordless Headset
Phonetobepriced25%abovecostsnomatterwhattheactualcostisandevenifthe
costs change daily. With this option, companies can price their inventory as a
percentageofcosts.Ifthecostgoesup,itchasesupthesalespriceoftheitem.Ifcosts
decline, the sales price drops in step to pass along the savings to the customer. This
pricingmethodallowsthecompanytosellgoodsatthelowestpossiblepricewhichstill
coverstheirfixedcosts,variablecosts,anddesiredprofitmargin.Allacompanyneeds
to do is determine its desired profit margin and they are off to the races.This
approachwillhelpStephaniehaveabetterchanceofachievinghergoalofmakingone
milliondollarsinprofit.
Business Alerts
UsingtheseExceldatatools,youcouldeasilyimportorlinktoaccountingsystemdata
andcreateformulastoalertyouwhenamountsdropbeloworexceedpredefinedlevels.
Forexampleyoumightcreatealertstoidentifywhencashfallsbelow$100,000orwhen
anoutstandingcustomerbalancerisesabove$$50,000.Youcouldcreatealertsformulas
to help identify inventory levels that need attention or to check that payroll amounts
arereasonable.Anexampleisshownbelow.
Page167
In this example, a formula has been created that compares the clients AR balance to
90%ofthecustomershighestpreviousbalance.Asyoucansee,someofthecustomers
havealreadyreachedthisthresholdandthismaybeagoodindicatortouseinstepping
upcollectionorcreditmeasuresregardingtheseparticularcustomers.
Of course the best Business Alert solutions are provided by the accounting systems
themselves. As an example, consider the Business Alert capabilities provided by
DynamicsGP.
DynamicsGPcanmonitorhundredsofcriticalmeasurementsonacontinualbasisand
bring these measurements to a users attention when they deviate significantly from
desired levels. For example, Dynamics GP can automatically warn a user in the event
that cash balances fall, inventory levels are too high, or gross margins decline below
acceptable levels. In Dynamics GP, these events trigger emails to the appropriate
personnel in a timely manner, so that corrective measures can be taken quickly. This
type of eventtriggered reporting is commonly referred to as Business Alerts which is
included in Dynamics GP as a part of the core financial system. The Dynamics GP
solutionprovidesthefollowingwizardforcreatingoreditingbusinessalerts.
Page168
DynamicsGPBusinessAlerts
providesawizardfor
creatingcomplex
calculations,scheduling
calculations,andreporting
CreatingBudgetsinExcelusingLinearRegressionAnalysis
Excelprovidestheabilitytoextrapolatedatafromyouraccountingsystemtoproduce
budgets, projections or forecasts using the least squares method of linear regression
analysis.Theprocessisextremelyeasyasfollows.
Inthisexamplewestartbyexporting3yearsworthofmonthlytrialbalancedatafrom
DynamicsGPtoMicrosoftExcel.InDynamicswehaveprintedthereporttothescreen
andalsotoacommaseparatedvalueprintfile.
Page169
ThissamedataisthenopenedinExcelasshowninthefollowingscreen.Ihavedeleted
thebalancesheetaccountlineitemsandinsertedacolumncalledCategorytohelptidy
thedata.
To create a budget for 2009, we will start by using the Subtotals Tool located on the
Data Ribbon. This action inserts subtotals in each column below each change in the
categorycolumn.
Page170
NextwecollapsetheoutlinetodisplayonlyrowtotalsandusetheSelectVisibleCells
Tool to select the visible data in Excel. With only the subtotal and grand total rows
displayed,weapplyacolorandthenexpandtheoutline. Theresultisthatformatting
hasbeenappliedtothesubtotalandgrandtotalrowstomakethemeasiertoread.
Tocreatethebudget,selectthe36columnswithnumericdata,thenclickanddragthe
FillHandleouttwelveadditionalcolumnstocreatethe2009budgetasshownbelow.
Page171
TheFillHandle
DragOut12Columns
TheresultisthatExceluseslinearregressionanalysistopredictthefuturevalues.Once
youhavecompletedthisprocessyoushouldinsertbetternumbersonthoselineitems
where you have better budget amounts. For example, you would look to the lease
agreementtodeterminethebestamounttouseforrentexpense.Youwoulduseyour
depreciationscheduletoprovidenumbersfordepreciationexpense.Howeverforthose
numberswhereyouhavenobetterbasistouseforbudgetpreparationpurposes,why
notuseLinearRegressionAnalysistoprovidetheanswer.
After all numbers have been updated, use the =ROUND() function to duplicate the
budgetonaseparateworkbookwithallamountsproperlyrounded.Formatasdesired,
labelthebudgetappropriately,andyouaredone.Acompletemonthlybudgetprepared
inlessthan5minutes.Thegreatnewsnowisthatsamebudgetcanbeimportedback
intoDynamicsGPwithoutreenteringthedata.
OtherAccountingSystemtoExcelFunctionality
TherearemanyadditionalwaysinwhichExcelcanworkwithyouraccountingsystem.
ForexampleyoucoulduseExceltoperformRatioAnalysis,generateOLAPdatacubes,
importaccountingtransactionsfromMicrosoftExcel,maintainandeditmasterfiledata
usingMicrosoftExcel(suchasaccountdescriptions,itemprices,etc).Youcouldalsouse
Exceltomailmergecontactinformationcontainedinyouraccountingsystem.Witha
goodimagination,thecleverCPAwillalwaysfindmanywaystouseExceltoworkwith
accountingsystemdata.
Page172
AttheUniversityofGeorgiaMr.CollinswaselectedPresidentofthePhiEtaSigmaHonorSociety,wasinitiatedinto
theBIFTADHonorSociety,wasamember ofAlphaTauOmegafraternity,andservedthreeyearsintheJudicial
Defender/Advocate program. At Glynn Academy High School Mr. Collins was Senior Class President, Class Co
Valedictorian,andreceivedaprinciplenominationtoAnnapolisNavalAcademy.Mr.Collinshasbeenmarriedfor
25yearsandhastwochildren.Hedevoteshisleisuretimetofamily,travel,tennis,fishing,snowskiing,andriding
motorcycles(dirtandstreet).Mr.Collinsispresidentofhishomeownersassociation,participatesintheGwinnett
CleanandBeautifulprogram,andvolunteersforCooperativeMinistriesfooddrive.Hewasafinalistinthe2009
SouthsFunniestAccountantCompetitionwhichraisesmoneyforJuniorAchievement.
SelectedPositions,Awards&Accomplishments:
1. 2008and2009ChairmanoftheSoutheastAccountingShowthesouth'slargestCPAevent.
2. Recipientofthe2008TomRadcliffOutstandingDiscussionLeaderAward.
3. NamedTopTenCPATechnologistsbyAccountingTechnologiesMagazine;NamedTop100Most
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, and general business. Mr. Collins' tax experience includes corporate,
individual, partnership, fiduciary, and estate taxplanning work. In thearea of finance, Mr. Collinshas prepared
feasibility studies and financial forecasts for nearly 300 projects seeking more than $3 billion in startup capital,
including field work for 80 of those projects. Mr. Collins is familiar with bond issues, Medicare and Medicaid
reimbursement,andconventionalfinancingmatters.Asaconsultant,Mr.CollinsworkedwiththeentireMicrosoft
Exceldevelopmentteamcontributingmorethan500pagesofdesignimprovementsmanyofwhicharefoundin
Exceltoday.
Page173
Thispageintentionallyblank
Page174
Page175