Sei sulla pagina 1di 175

ASA Research

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 CourseLevel PreRequisites AdvancedPreparation PresentationMethod RecommendedCPECredit Handouts Instructors ToincreasetheproductivityofaccountantsandCPAsusing ExcelbyintroducingthemtoadvancedcapabilitieswithinExcel Advanced GoodFamiliaritywithMicrosoftExcel None LivelectureusingfullcolorprojectionsystemsandliveInternet accesswithfollowupcoursematerials 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

Excel & The Internet

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. Publishan entireExcelfileasawebpagewithAutorepublishing Aninterestingfeatureis theAutoRepublishfeaturethatautomaticallyupdatesyourwebbasedExceldatawheneverit changesinyourExcelworkbook.Toenablethisfeature,simplechecktheAutoRepublishevery timethisworkbookissavedcheckboxasshownbelow.

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). 3. Recomputation It also introduced intelligent cell recomputation, where only cells dependent on the cell being modified are updated (previous spreadsheet programs recomputedeverythingallthetimeorwaitedforaspecificusercommand).

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 Main spreadsheet format which holds data in worksheets, charts,andmacros Addscustomfunctionality;writteninVBA Adds custom functionality; written in C++/C, Visual Basic, Fortran,etc.andcompiledintoaspecialdynamiclinklibrary ArrangementofthewindowsofmultipleWorkbooks

Spreadsheet .xls Addin (VBA) Toolbar Chart Dialog Archive .xla .xlb .xlc .xld .xlk

Addin(DLL) .xll Macro Template Module .xlm .xlt .xlv

Workspace .xlw

www.ExcelAdvisor.net

Page16

CopyrightMarch2010

6. OfficeOpenXMLMicrosoftExcel2007,alongwiththeotherproductsintheMicrosoft Office2007suite,introducesahostofnewfileformats.TheseformpartoftheOffice OpenXML(OOXML)specification. NewExcel2007formats Format Excel Workbook Extension Description .xlsx The default Excel 2007 workbook format. In reality a ZIP compressed archive with a directory structure of XML text documents. Functions as the primary replacement for the formerbinary.xlsformat,althoughitdoesnotsupportExcel macrosforsecurityreasons. AsExcelWorkbook,butwithmacrosupport.

Excel Macro .xlsm enabled Workbook Excel Binary .xlsb Workbook Excel Macro .xltm enabled Template ExcelAddin .xlam

As Excel Macroenabled Workbook, but storing information inbinaryformratherthanXMLdocumentsforopeningand savingespeciallylargedocuments. A template document that forms a basis for actual workbooks,withmacrosupport.Thereplacementfortheold .xltformat. Excel addin to add extra functionality and tools. Inherent macrosupportduetothefilepurpose.

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. 7. Accuracy Due to Excel's foundation on floating point calculations, the statistical accuracyofExcelhasbeencriticizedaslackingcertainstatisticaltools. 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. COUNT VALUE TRIM RIGHT, UPPER MONTH ROUND MEDIAN NPV OR YIELD ISNA RAND 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 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 DAVERAGE DCOUNT DCOUNTA DGET DMAX DMIN DPRODUCT Description Returnstheaverageofselecteddatabaseentries Countsthecellsthatcontainnumbersinadatabase Countsnonblankcellsinadatabase Extractsfromadatabaseasinglerecordthatmatchesthespecifiedcriteria Returnsthemaximumvaluefromselecteddatabaseentries Returnstheminimumvaluefromselecteddatabaseentries Multipliesthevaluesinaparticularfieldofrecordsthatmatchthecriteriain adatabase Estimatesthestandarddeviationbasedonasampleofselecteddatabase entries Calculatesthestandarddeviationbasedontheentirepopulationofselected databaseentries Addsthenumbersinthefieldcolumnofrecordsinthedatabasethatmatch thecriteria Estimatesvariancebasedonasamplefromselecteddatabaseentries Calculatesvariancebasedontheentirepopulationofselecteddatabase entries

1 2 3 4 5 6 7

DSTDEV

DSTDEVP

10

DSUM

11 12

DVAR DVARP

DateandTimeFunctions Function DATE DATEVALUE DAY DAYS360 EDATE Description Returnstheserialnumberofaparticulardate Convertsadateintheformoftexttoaserialnumber Convertsaserialnumbertoadayofthemonth Calculatesthenumberofdaysbetweentwodatesbasedona360dayyear Returnstheserialnumberofthedatethatistheindicatednumberofmonths

13 14 15 16 17

www.ExcelAdvisor.net

Page20

CopyrightMarch2010

beforeorafterthestartdate 18 EOMONTH Returnstheserialnumberofthelastdayofthemonthbeforeoraftera specifiednumberofmonths Convertsaserialnumbertoanhour Convertsaserialnumbertoaminute Convertsaserialnumbertoamonth Returnsthenumberofwholeworkdaysbetweentwodates Returnstheserialnumberofthecurrentdateandtime Convertsaserialnumbertoasecond Returnstheserialnumberofaparticulartime Convertsatimeintheformoftexttoaserialnumber Returnstheserialnumberoftoday'sdate Convertsaserialnumbertoadayoftheweek Convertsaserialnumbertoanumberrepresentingwheretheweekfalls numericallywithayear Returnstheserialnumberofthedatebeforeorafteraspecifiednumberof workdays Convertsaserialnumbertoayear Returnstheyearfractionrepresentingthenumberofwholedaysbetween start_dateandend_date

19 20 21 22 23 24 25 26 27 28 29

HOUR MINUTE MONTH NETWORKDAYS NOW SECOND TIME TIMEVALUE TODAY WEEKDAY WEEKNUM

30

WORKDAY

31 32

YEAR YEARFRAC

EngineeringFunctions Function BESSELI BESSELJ BESSELK Description ReturnsthemodifiedBesselFunctionIn(x) ReturnstheBesselFunctionJn(x) ReturnsthemodifiedBesselFunctionKn(x)

33 34 35

www.ExcelAdvisor.net

Page21

CopyrightMarch2010

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

BESSELY BIN2DEC BIN2HEX BIN2OCT COMPLEX CONVERT DEC2BIN DEC2HEX DEC2OCT DELTA ERF ERFC GESTEP HEX2BIN HEX2DEC HEX2OCT IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMDIV IMEXP IMLN

ReturnstheBesselFunctionYn(x) Convertsabinarynumbertodecimal Convertsabinarynumbertohexadecimal Convertsabinarynumbertooctal Convertsrealandimaginarycoefficientsintoacomplexnumber Convertsanumberfromonemeasurementsystemtoanother Convertsadecimalnumbertobinary Convertsadecimalnumbertohexadecimal Convertsadecimalnumbertooctal Testswhethertwovaluesareequal ReturnstheerrorFunction ReturnsthecomplementaryerrorFunction Testswhetheranumberisgreaterthanathresholdvalue Convertsahexadecimalnumbertobinary Convertsahexadecimalnumbertodecimal Convertsahexadecimalnumbertooctal Returnstheabsolutevalue(modulus)ofacomplexnumber Returnstheimaginarycoefficientofacomplexnumber Returnstheargumenttheta,anangleexpressedinradians Returnsthecomplexconjugateofacomplexnumber Returnsthecosineofacomplexnumber Returnsthequotientoftwocomplexnumbers Returnstheexponentialofacomplexnumber Returnsthenaturallogarithmofacomplexnumber

www.ExcelAdvisor.net

Page22

CopyrightMarch2010

60 61 62 63 64 65 66 67 68 69 70 71

IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSIN IMSQRT IMSUB IMSUM OCT2BIN OCT2DEC OCT2HEX

Returnsthebase10logarithmofacomplexnumber Returnsthebase2logarithmofacomplexnumber Returnsacomplexnumberraisedtoanintegerpower Returnstheproductoffrom2to29complexnumbers Returnstherealcoefficientofacomplexnumber Returnsthesineofacomplexnumber Returnsthesquarerootofacomplexnumber Returnsthedifferencebetweentwocomplexnumbers Returnsthesumofcomplexnumbers Convertsanoctalnumbertobinary Convertsanoctalnumbertodecimal Convertsanoctalnumbertohexadecimal

FinancialFunctions Function ACCRINT ACCRINTM AMORDEGRC Description Returnstheaccruedinterestforasecuritythatpaysperiodicinterest Returnstheaccruedinterestforasecuritythatpaysinterestatmaturity Returnsthedepreciationforeachaccountingperiodbyusingadepreciation coefficient Returnsthedepreciationforeachaccountingperiod Returnsthenumberofdaysfromthebeginningofthecouponperiodtothe settlementdate Returnsthenumberofdaysinthecouponperiodthatcontainsthe settlementdate Returnsthenumberofdaysfromthesettlementdatetothenextcoupon date

72 73 74

75 76

AMORLINC COUPDAYBS

77

COUPDAYS

78

COUPDAYSNC

www.ExcelAdvisor.net

Page23

CopyrightMarch2010

79 80

COUPNCD COUPNUM

Returnsthenextcoupondateafterthesettlementdate Returnsthenumberofcouponspayablebetweenthesettlementdateand maturitydate Returnsthepreviouscoupondatebeforethesettlementdate Returnsthecumulativeinterestpaidbetweentwoperiods Returnsthecumulativeprincipalpaidonaloanbetweentwoperiods Returnsthedepreciationofanassetforaspecifiedperiodbyusingthefixed decliningbalancemethod Returnsthedepreciationofanassetforaspecifiedperiodbyusingthe doubledecliningbalancemethodorsomeothermethodthatyouspecify Returnsthediscountrateforasecurity Convertsadollarprice,expressedasafraction,intoadollarprice,expressed asadecimalnumber Convertsadollarprice,expressedasadecimalnumber,intoadollarprice, expressedasafraction Returnstheannualdurationofasecuritywithperiodicinterestpayments Returnstheeffectiveannualinterestrate Returnsthefuturevalueofaninvestment Returnsthefuturevalueofaninitialprincipalafterapplyingaseriesof compoundinterestrates Returnstheinterestrateforafullyinvestedsecurity Returnstheinterestpaymentforaninvestmentforagivenperiod Returnstheinternalrateofreturnforaseriesofcashflows Calculatestheinterestpaidduringaspecificperiodofaninvestment ReturnstheMacauleymodifieddurationforasecuritywithanassumedpar valueof$100 Returnstheinternalrateofreturnwherepositiveandnegativecashflowsare financedatdifferentrates

81 82 83 84

COUPPCD CUMIPMT CUMPRINC DB

85

DDB

86 87

DISC DOLLARDE

88

DOLLARFR

89 90 91 92

DURATION EFFECT FV FVSCHEDULE

93 94 95 96 97

INTRATE IPMT IRR ISPMT MDURATION

98

MIRR

www.ExcelAdvisor.net

Page24

CopyrightMarch2010

99

NOMINAL

Returnstheannualnominalinterestrate Returnsthenumberofperiodsforaninvestment Returnsthenetpresentvalueofaninvestmentbasedonaseriesofperiodic cashflowsandadiscountrate Returnsthepriceper$100facevalueofasecuritywithanoddfirstperiod Returnstheyieldofasecuritywithanoddfirstperiod Returnsthepriceper$100facevalueofasecuritywithanoddlastperiod Returnstheyieldofasecuritywithanoddlastperiod Returnstheperiodicpaymentforanannuity Returnsthepaymentontheprincipalforaninvestmentforagivenperiod Returnsthepriceper$100facevalueofasecuritythatpaysperiodicinterest Returnsthepriceper$100facevalueofadiscountedsecurity Returnsthepriceper$100facevalueofasecuritythatpaysinterestat maturity Returnsthepresentvalueofaninvestment Returnstheinterestrateperperiodofanannuity Returnstheamountreceivedatmaturityforafullyinvestedsecurity Returnsthestraightlinedepreciationofanassetforoneperiod Returnsthesumofyears'digitsdepreciationofanassetforaspecified period ReturnsthebondequivalentyieldforaTreasurybill Returnsthepriceper$100facevalueforaTreasurybill ReturnstheyieldforaTreasurybill Returnsthedepreciationofanassetforaspecifiedorpartialperiodbyusing adecliningbalancemethod Returnstheinternalrateofreturnforascheduleofcashflowsthatisnot

100 NPER 101 NPV

102 ODDFPRICE 103 ODDFYIELD 104 ODDLPRICE 105 ODDLYIELD 106 PMT 107 PPMT 108 PRICE 109 PRICEDISC 110 PRICEMAT

111 PV 112 RATE 113 RECEIVED 114 SLN 115 SYD

116 TBILLEQ 117 TBILLPRICE 118 TBILLYIELD 119 VDB

120 XIRR

www.ExcelAdvisor.net

Page25

CopyrightMarch2010

necessarilyperiodic 121 XNPV Returnsthenetpresentvalueforascheduleofcashflowsthatisnot necessarilyperiodic Returnstheyieldonasecuritythatpaysperiodicinterest Returnstheannualyieldforadiscountedsecurity;forexample,aTreasurybill Returnstheannualyieldofasecuritythatpaysinterestatmaturity

122 YIELD 123 YIELDDISC 124 YIELDMAT


InformationFunctions Function Description Returnsinformationabouttheformatting,location,orcontentsofacell Returnsanumbercorrespondingtoanerrortype Returnsinformationaboutthecurrentoperatingenvironment ReturnsTRUEifthevalueisblank ReturnsTRUEifthevalueisanyerrorvalueexcept#N/A ReturnsTRUEifthevalueisanyerrorvalue ReturnsTRUEifthenumberiseven ReturnsTRUEifthevalueisalogicalvalue ReturnsTRUEifthevalueisthe#N/Aerrorvalue ReturnsTRUEifthevalueisnottext ReturnsTRUEifthevalueisanumber ReturnsTRUEifthenumberisodd ReturnsTRUEifthevalueisareference ReturnsTRUEifthevalueistext Returnsavalueconvertedtoanumber Returnstheerrorvalue#N/A

125 CELL 126 ERROR.TYPE 127 INFO 128 ISBLANK 129 ISERR 130 ISERROR 131 ISEVEN 132 ISLOGICAL 133 ISNA 134 ISNONTEXT 135 ISNUMBER 136 ISODD 137 ISREF 138 ISTEXT 139 N 140 NA

www.ExcelAdvisor.net

Page26

CopyrightMarch2010

141 TYPE 17

Returnsanumberindicatingthedatatypeofavalue

LogicalFunctions Function Description ReturnsTRUEifallofitsargumentsareTRUE ReturnsthelogicalvalueFALSE Specifiesalogicaltesttoperform Reversesthelogicofitsargument ReturnsTRUEifanyargumentisTRUE ReturnsthelogicalvalueTRUE

142 AND 143 FALSE 144 IF 145 NOT 146 OR 147 TRUE

LookupandReferenceFunctions Function Description Returnsareferenceastexttoasinglecellinaworksheet Returnsthenumberofareasinareference Choosesavaluefromalistofvalues Returnsthecolumnnumberofareference Returnsthenumberofcolumnsinareference ReturnsdatastoredinaPivotTable Looksinthetoprowofanarrayandreturnsthevalueoftheindicatedcell Createsashortcutorjumpthatopensadocumentstoredonanetwork server,anintranet,ortheInternet Usesanindextochooseavaluefromareferenceorarray Returnsareferenceindicatedbyatextvalue Looksupvaluesinavectororarray

148 ADDRESS 149 AREAS 150 CHOOSE 151 COLUMN 152 COLUMNS 153 GETPIVOTDATA 154 HLOOKUP 155 HYPERLINK

156 INDEX 157 INDIRECT 158 LOOKUP

www.ExcelAdvisor.net

Page27

CopyrightMarch2010

159 MATCH 160 OFFSET 161 ROW 162 ROWS 163 RTD

Looksupvaluesinareferenceorarray Returnsareferenceoffsetfromagivenreference Returnstherownumberofareference Returnsthenumberofrowsinareference RetrievesrealtimedatafromaprogramthatsupportsCOM automation(Automation:Awaytoworkwithanapplication'sobjectsfrom anotherapplicationordevelopmenttool.FormerlycalledOLEAutomation, AutomationisanindustrystandardandafeatureoftheComponentObject Model(COM).) Returnsthetransposeofanarray Looksinthefirstcolumnofanarrayandmovesacrosstherowtoreturnthe valueofacell

164 TRANSPOSE 165 VLOOKUP

MathandTrigonometryFunctions Function Description Returnstheabsolutevalueofanumber Returnsthearccosineofanumber Returnstheinversehyperboliccosineofanumber Returnsthearcsineofanumber Returnstheinversehyperbolicsineofanumber Returnsthearctangentofanumber Returnsthearctangentfromxandycoordinates Returnstheinversehyperbolictangentofanumber Roundsanumbertothenearestintegerortothenearestmultipleof significance Returnsthenumberofcombinationsforagivennumberofobjects Returnsthecosineofanumber

166 ABS 167 ACOS 168 ACOSH 169 ASIN 170 ASINH 171 ATAN 172 ATAN2 173 ATANH 174 CEILING

175 COMBIN 176 COS

www.ExcelAdvisor.net

Page28

CopyrightMarch2010

177 COSH 178 DEGREES 179 EVEN 180 EXP 181 FACT 182 FACTDOUBLE 183 FLOOR 184 GCD 185 INT 186 LCM 187 LN 188 LOG 189 LOG10 190 MDETERM 191 MINVERSE 192 MMULT 193 MOD 194 MROUND 195 MULTINOMIAL 196 ODD 197 PI 198 POWER 199 PRODUCT 200 QUOTIENT

Returnsthehyperboliccosineofanumber Convertsradianstodegrees Roundsanumberuptothenearesteveninteger Returnseraisedtothepowerofagivennumber Returnsthefactorialofanumber Returnsthedoublefactorialofanumber Roundsanumberdown,towardzero Returnsthegreatestcommondivisor Roundsanumberdowntothenearestinteger Returnstheleastcommonmultiple Returnsthenaturallogarithmofanumber Returnsthelogarithmofanumbertoaspecifiedbase Returnsthebase10logarithmofanumber Returnsthematrixdeterminantofanarray Returnsthematrixinverseofanarray Returnsthematrixproductoftwoarrays Returnstheremainderfromdivision Returnsanumberroundedtothedesiredmultiple Returnsthemultinomialofasetofnumbers Roundsanumberuptothenearestoddinteger Returnsthevalueofpi Returnstheresultofanumberraisedtoapower Multipliesitsarguments Returnstheintegerportionofadivision

www.ExcelAdvisor.net

Page29

CopyrightMarch2010

201 RADIANS 202 RAND 203 RANDBETWEEN 204 ROMAN 205 ROUND 206 ROUNDDOWN 207 ROUNDUP 208 SERIESSUM 209 SIGN 210 SIN 211 SINH 212 SQRT 213 SQRTPI 214 SUBTOTAL 215 SUM 216 SUMIF 217 SUMPRODUCT 218 SUMSQ 219 SUMX2MY2

Convertsdegreestoradians Returnsarandomnumberbetween0and1 Returnsarandomnumberbetweenthenumbersyouspecify Convertsanarabicnumeraltoroman,astext Roundsanumbertoaspecifiednumberofdigits Roundsanumberdown,towardzero Roundsanumberup,awayfromzero Returnsthesumofapowerseriesbasedontheformula Returnsthesignofanumber Returnsthesineofthegivenangle Returnsthehyperbolicsineofanumber Returnsapositivesquareroot Returnsthesquarerootof(number*pi) Returnsasubtotalinalistordatabase Addsitsarguments Addsthecellsspecifiedbyagivencriteria Returnsthesumoftheproductsofcorrespondingarraycomponents Returnsthesumofthesquaresofthearguments Returnsthesumofthedifferenceofsquaresofcorrespondingvaluesintwo arrays Returnsthesumofthesumofsquaresofcorrespondingvaluesintwoarrays Returnsthesumofsquaresofdifferencesofcorrespondingvaluesintwo arrays Returnsthetangentofanumber Returnsthehyperbolictangentofanumber

220 SUMX2PY2 221 SUMXMY2

222 TAN 223 TANH

www.ExcelAdvisor.net

Page30

CopyrightMarch2010

224 TRUNC

Truncatesanumbertoaninteger

StatisticalFunctions Function Description Returnstheaverageoftheabsolutedeviationsofdatapointsfromtheir mean Returnstheaverageofitsarguments Returnstheaverageofitsarguments,includingnumbers,text,andlogical values ReturnsthebetacumulativedistributionFunction ReturnstheinverseofthecumulativedistributionFunctionforaspecified betadistribution Returnstheindividualtermbinomialdistributionprobability Returnstheonetailedprobabilityofthechisquareddistribution Returnstheinverseoftheonetailedprobabilityofthechisquared distribution Returnsthetestforindependence Returnstheconfidenceintervalforapopulationmean Returnsthecorrelationcoefficientbetweentwodatasets Countshowmanynumbersareinthelistofarguments Countshowmanyvaluesareinthelistofarguments Countsthenumberofblankcellswithinarange Countsthenumberofnonblankcellswithinarangethatmeetthegiven criteria Returnscovariance,theaverageoftheproductsofpaireddeviations Returnsthesmallestvalueforwhichthecumulativebinomialdistributionis lessthanorequaltoacriterionvalue

225 AVEDEV

226 AVERAGE 227 AVERAGEA

228 BETADIST 229 BETAINV

230 BINOMDIST 231 CHIDIST 232 CHIINV

233 CHITEST 234 CONFIDENCE 235 CORREL 236 COUNT 237 COUNTA 238 COUNTBLANK 239 COUNTIF

240 COVAR 241 CRITBINOM

www.ExcelAdvisor.net

Page31

CopyrightMarch2010

242 DEVSQ 243 EXPONDIST 244 FDIST 245 FINV 246 FISHER 247 FISHERINV 248 FORECAST 249 FREQUENCY 250 FTEST 251 GAMMADIST 252 GAMMAINV 253 GAMMALN 254 GEOMEAN 255 GROWTH 256 HARMEAN 257 HYPGEOMDIST 258 INTERCEPT 259 KURT 260 LARGE 261 LINEST 262 LOGEST 263 LOGINV 264 LOGNORMDIST 265 MAX

Returnsthesumofsquaresofdeviations Returnstheexponentialdistribution ReturnstheFprobabilitydistribution ReturnstheinverseoftheFprobabilitydistribution ReturnstheFishertransformation ReturnstheinverseoftheFishertransformation Returnsavaluealongalineartrend Returnsafrequencydistributionasaverticalarray ReturnstheresultofanFtest Returnsthegammadistribution Returnstheinverseofthegammacumulativedistribution ReturnsthenaturallogarithmofthegammaFunction,(x) Returnsthegeometricmean Returnsvaluesalonganexponentialtrend Returnstheharmonicmean Returnsthehypergeometricdistribution Returnstheinterceptofthelinearregressionline Returnsthekurtosisofadataset Returnsthekthlargestvalueinadataset Returnstheparametersofalineartrend Returnstheparametersofanexponentialtrend Returnstheinverseofthelognormaldistribution Returnsthecumulativelognormaldistribution Returnsthemaximumvalueinalistofarguments

www.ExcelAdvisor.net

Page32

CopyrightMarch2010

266 MAXA

Returnsthemaximumvalueinalistofarguments,includingnumbers,text, andlogicalvalues Returnsthemedianofthegivennumbers Returnstheminimumvalueinalistofarguments Returnsthesmallestvalueinalistofarguments,includingnumbers,text,and logicalvalues Returnsthemostcommonvalueinadataset Returnsthenegativebinomialdistribution Returnsthenormalcumulativedistribution Returnstheinverseofthenormalcumulativedistribution Returnsthestandardnormalcumulativedistribution Returnstheinverseofthestandardnormalcumulativedistribution ReturnsthePearsonproductmomentcorrelationcoefficient Returnsthekthpercentileofvaluesinarange Returnsthepercentagerankofavalueinadataset Returnsthenumberofpermutationsforagivennumberofobjects ReturnsthePoissondistribution Returnstheprobabilitythatvaluesinarangearebetweentwolimits Returnsthequartileofadataset Returnstherankofanumberinalistofnumbers ReturnsthesquareofthePearsonproductmomentcorrelationcoefficient Returnstheskewnessofadistribution Returnstheslopeofthelinearregressionline Returnsthekthsmallestvalueinadataset Returnsanormalizedvalue

267 MEDIAN 268 MIN 269 MINA

270 MODE 271 NEGBINOMDIST 272 NORMDIST 273 NORMINV 274 NORMSDIST 275 NORMSINV 276 PEARSON 277 PERCENTILE 278 PERCENTRANK 279 PERMUT 280 POISSON 281 PROB 282 QUARTILE 283 RANK 284 RSQ 285 SKEW 286 SLOPE 287 SMALL 288 STANDARDIZE

www.ExcelAdvisor.net

Page33

CopyrightMarch2010

289 STDEV 290 STDEVA

Estimatesstandarddeviationbasedonasample Estimatesstandarddeviationbasedonasample,includingnumbers,text,and logicalvalues Calculatesstandarddeviationbasedontheentirepopulation Calculatesstandarddeviationbasedontheentirepopulation,including numbers,text,andlogicalvalues Returnsthestandarderrorofthepredictedyvalueforeachxinthe regression ReturnstheStudent'stdistribution ReturnstheinverseoftheStudent'stdistribution Returnsvaluesalongalineartrend Returnsthemeanoftheinteriorofadataset ReturnstheprobabilityassociatedwithaStudent'sttest Estimatesvariancebasedonasample Estimatesvariancebasedonasample,includingnumbers,text,andlogical values Calculatesvariancebasedontheentirepopulation Calculatesvariancebasedontheentirepopulation,includingnumbers,text, andlogicalvalues ReturnstheWeibulldistribution Returnstheonetailedprobabilityvalueofaztest

291 STDEVP 292 STDEVPA

293 STEYX

294 TDIST 295 TINV 296 TREND 297 TRIMMEAN 298 TTEST 299 VAR 300 VARA

301 VARP 302 VARPA

303 WEIBULL 304 ZTEST


TextFunctions Function Description Changesfullwidth(doublebyte)Englishlettersorkatakanawithina characterstringtohalfwidth(singlebyte)characters Convertsanumbertotext,usingthe(baht)currencyformat

305 ASC

306 BAHTTEXT

www.ExcelAdvisor.net

Page34

CopyrightMarch2010

307 CHAR 308 CLEAN 309 CODE 310 CONCATENATE 311 DOLLAR 312 EXACT 313 FIND,FINDB 314 FIXED 315 JIS

Returnsthecharacterspecifiedbythecodenumber Removesallnonprintablecharactersfromtext Returnsanumericcodeforthefirstcharacterinatextstring Joinsseveraltextitemsintoonetextitem Convertsanumbertotext,usingthe$(dollar)currencyformat Checkstoseeiftwotextvaluesareidentical Findsonetextvaluewithinanother(casesensitive) Formatsanumberastextwithafixednumberofdecimals Changeshalfwidth(singlebyte)Englishlettersorkatakanawithinacharacter stringtofullwidth(doublebyte)characters Returnstheleftmostcharactersfromatextvalue Returnsthenumberofcharactersinatextstring Convertstexttolowercase Returnsaspecificnumberofcharactersfromatextstringstartingatthe positionyouspecify Extractsthephonetic(furigana)charactersfromatextstring Capitalizesthefirstletterineachwordofatextvalue Replacescharacterswithintext

316 LEFT,LEFTB 317 LEN,LENB 318 LOWER 319 MID,MIDB

320 PHONETIC 321 PROPER 322 REPLACE, REPLACEB 323 REPT 324 RIGHT,RIGHTB 325 SEARCH, SEARCHB 326 SUBSTITUTE 327 T 328 TEXT

Repeatstextagivennumberoftimes Returnstherightmostcharactersfromatextvalue Findsonetextvaluewithinanother(notcasesensitive)

Substitutesnewtextforoldtextinatextstring Convertsitsargumentstotext Formatsanumberandconvertsittotext

www.ExcelAdvisor.net

Page35

CopyrightMarch2010

329 TRIM 330 UPPER 331 VALUE


Removesspacesfromtext Convertstexttouppercase Convertsatextargumenttoanumber

ExternalFunctions Function Description Convertsanumbertoeuros,convertsanumberfromeurostoaeuro membercurrency,orconvertsanumberfromoneeuromembercurrencyto anotherbyusingtheeuroasanintermediary(triangulation) Connectswithanexternaldatasourceandrunsaqueryfromaworksheet, thenreturnstheresultasanarraywithouttheneedformacroprogramming

332 EUROCONVERT

333 SQL.REQUEST

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

10. =SEARCH 11. =LEN 12. =SUBSTITUTE 13. =REPLACE 14. =LEFT 15. =MID 16. =RIGHT 17. =VALUE 18. =CONCATENATE

19. =TEXT 20. =TRIM 21. =CLEAN 22. =FIXED 23. =DOLLAR 24. =CODE 25. Macros

www.ExcelAdvisor.net

Page43

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

32. =HLOOKUP Searchesforavalueinthetoprowofatableoranarrayofvalues,and thenreturnsavalueinthesamecolumnfromarowyouspecifyinthetableorarray.


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.

37. RAND( ), RANDBETWEEN( ), ROUND( ) In Excel 2003, RANDBETWEEN is not in the standard EXCEL installation but if the analysis tool pack is installed and the addin activateditisanextremelyusefulfunction.

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 "address" "col" "color" "contents" "filename" "format" Returns Referenceofthefirstcellinreference,astext. Columnnumberofthecellinreference. 1ifthecellisformattedincolorfornegativevalues;otherwisereturns0(zero). Valueoftheupperleftcellinreference;notaformula. Filename(includingfullpath)ofthefilethatcontainsreference,astext.Returnsempty text("")iftheworksheetthatcontainsreferencehasnotyetbeensaved. 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. 0ifthecellisnotlocked,and1ifthecellislocked. Rownumberofthecellinreference. Textvaluecorrespondingtothetypeofdatainthecell.Returns"b"forblankifthecellis empty, "l" for label if the cell contains a text constant, and "v" for value if the cell containsanythingelse.

"protect" "row" "type"

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 General 0 #,##0 0.00 #,##0.00 $#,##0_);($#,##0) $#,##0_);[Red]($#,##0) $#,##0.00_);($#,##0.00) $#,##0.00_);[Red]($#,##0.00) 0% 0.00% 0.00E+00 #?/?or#??/?? m/d/yyorm/d/yyh:mmormm/dd/yy dmmmyyorddmmmyy dmmmorddmmm mmmyy mm/dd h:mmAM/PM h:mm:ssAM/PM h:mm h:mm:ss CELLreturns "G" "F0" ",0" "F2" ",2" "C0" "C0" "C2" "C2" "P0" "P2" "S2" "G" "D4" "D1" "D2" "D3" "D5" "D7" "D6" "D9" "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. Perhaps a better example use of this feature would be to create a non alphabeticcustomlistofyourchartofaccounts,andthensorttransactionsto produce a general ledger in chart of account order even if your preferred chartofaccountsisnotalphabetical.thepartnersenioritydoesnotmatchthe alphabeticnames,norany

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.

6. Filters Enabled A dropdown arrow means that filtering is enabledbut not applied. 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. 9. This Year vs. YeartoDate Filtering This Year and YeartoDate are different in the way that future dates arehandled.ThisYearcanreturndates in the future for the current year, whereas Year to Date only returns dates up to and including the current date. 10. Filtering Dates All date filters are based on the Gregorian calendar as decreed by Pope Gregory XIII, after whom the calendar was named, on 24 February 1582. The Gregorian calendar modifies the Julian calendar's regular fouryearcycleofleapyearsasfollows:Everyyearthatisexactlydivisiblebyfour isaleapyear,exceptforyearsthatareexactlydivisibleby100;thecenturialyears thatareexactlydivisibleby400arestillleapyears.Forexample,theyear1900is notaleapyear;theyear2000isaleapyear.

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. 13. Above & Below Average Filtering On the Data tab, in the Sort & Filter group, click Filter. Point to Filter by Numbers that are Above/BelowAverage.NoteThesevalues Page64

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.

Excel provides an automatic subtotaling which will automaticallycalculateandinsertsubtotalsandgrandtotalsinyourlistortable.Once inserted, Excel recalculates subtotal and grand total values automatically as you enter and edit the detail data. The Subtotal command also outlines the list so that you can displayandhidethedetailrowsforeachsubtotal.ExamplesofatheSubtotaldialogbox andaresultingsubtotaledtableareshownbelow.

Data Subtotals

Page66

KeypointstoConsiderWhenUsingSubtotalingareasfollows: 1. ContiguousDataTheSubtotaltoolsworksbestwhenyouareworkingwithdata thatiscontiguous.Inotherwords,yourdatashouldcontainnoblankcolumns,no blankrows,andthecolumnsmustallbelabeled. 2. SortBeforeYourSubtotalYoumustsortthedatabythecolumnyouwishto Subtotalby,elseyouwillreceiveerroneousresults.

3. Other Mathematical Applications The Subtotal tool not only calculates subtotals, but it can also calculate minimums, maximums, averages, standard deviations,andotherfunctions.

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.

Loan Analysis In this exercise, we start by creating a simple Payment function to calculatethepaymentamountofaloangivenaloanamount,interestrateandnumber ofperiods.

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. InstallMicrosoftQueryIfMicrosoftQueryisnotavailable,youmightneedtoinstallit. Specifyasourcetoretrievedatafrom,andthenstartusingMicrosoftQueryForexample,if you want to insert database information, display the Database toolbar, click Insert Database, clickGetData,andthenclickMSQuery.

2.

3.

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.

4. Enable Macros If the macrofunctions are disabled,you can enable them by selecting Macro Security in the Code group on the Developer tab as shown below.

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
A combination chart is used to show one chart on top of another chart, using the same scale by percentage. This allows the reader to better study the data to determine whether relationships, if any, exist between the two sets of data. For example, consider the simple study hours and resulting grade information shown to the right for a new collegestudentwewillcallhimAustin. Wehavecompiledaworksheetshowingthenumberofhours inwhichAustinstudiedeachweek,andtheaveragescoreshe achievedonhishomework,quizzes,testandexams. 1. Start by creating a line chart from your entire data range 2. Rescalethetoplinebyrightclickingandchange the seriesoptiontouseasecondaryaxis 3. Notetherangesoneachsideofthechart 4. Next right mouse click one of the lines and choose ChangeSeriesCharttype,andchooseacolumnchart format 5. Nowapplyachartformatandstudyyourdateforany usefulrelationships

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 SpeculationStocks SpeculationStocks SpeculationStocks SpeculationStocks CheckingAccount RealEstate UndevelopedLand Townhome FFIDX EDSIX AFATX FidelityFund
Evergreen Disciplined Value Fund Afba 5Star Science & Technology

Symbol MSFT T DOW DD UPS XOM KO GOOG ORCL IN MRK

CompanyName Microsoft AT&TInc. DowChemical DuPont UPS ExonMobil CocaCola Google Oracle Intermec Merck

IntialAmount 50,000 50,000 50,000 50,000 50,000 50,000 50,000 50,000 50,000 50,000 50,000 100,000 70,000 180,000 50,000 25,000 25,000 1,000,000

MutualFund MutualFund MutualFund

17. SetupaninitialPortfoliothatlisttheseinvestmentsandtheinitialamountsthat Mr. Slade has decided to place in each investment. Include a column for share priceandthetotalnumberofsharesasshownbelow.

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 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 CheckingAccount MutualFund RealEstate 25,326 SpeculationStocks 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:
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

1 2 3 4 5 6 7 8 9 10 11 12 13

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. 2. Complete More than just an accounting system, Dynamics GP is a complete business ManagementSystem which includesmany integrated solutions within thefollowingcategories: Financial Management ProjectManagement SupplyChain Management 3. ModulesDynamicsGPhasmorethan50modulesand200addinsolutions. 4. Customers More than 100,000 companies in more than 50 countries use the MicrosoftDynamicssolutions. 5. PartnersTherearemorethan5,200PartnerssellingandsupportingMicrosoft DynamicssolutionsintheUS,andmorethan9,900worldwide.

BusinessIntelligenceand Reporting CustomerRelationship Management CollaborativeWorkspace

HumanResource Management Manufacturing Configurationand Development

Page139

6. FamiliarDesignMicrosoftDynamicssolutionsuseamenudesignandinterface thatissimilartothatfoundinMicrosoftOfficeSuiteofproductswhichmeans youareprobablyalreadyfamiliarwiththeDynamicsproducts. 7. Role Based Menus Dynamics GP uses a Rolebased User Interface which is tailoredforeachuserdependingonwhatroleyouplayinanorganization.This means that the accounting system provides menus and options that most relevanttoyou. 8. Migration Path from QuickBooks and Peachtree Microsoft provides an upgrade path for QuickBooks and Peachtree users which offer the following benefits:
a) Dynamics GP provides with more than twice as many features compared to QuickBooks EnterpriseorPeachtreeQuantum. b) Dynamics.GPcanhandlemillionsoftransactionswithoutslowingdownwhereasQuickBooks andPeachtreedatabaseperformancecandeclinedramatically. c) Dynamics GP provides stronger financial reporting with scheduled reports which can be deliveredviaemailtopredeterminedrecipients. d) Dynamics GP offers a data conversion capability in which QuickBooks or Peachtree data is automaticallyconvertedforuseinDynamicsGP. e) Dynamics.GPoffersBusinessReadypricingwhichallowsQuickBooksorPeachtreeusersto migrate to Dynamics.GP for about the same cost as migrating to QuickBooks Enterprise or Peachtree Quantum. (Dynamics GP is priced per user beginning at $2,150. QuickBooks EnterpriseandPeachtreeQuantumarepricedfrom$3,000to$9,500). f) TohelpQuickBooksandPeachtreeusersfeelrightathome,DynamicGPincludesdataentry screens that look and feel similar to the screens you are already used to. For example, followingarethecheckwritingscreensforbothQuickBooksandMicrosoftDynamicsGP.

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.

NoticealsothatIFfunctionshavebeeninsertedintotheprofitpercentageformulasto preventDividebyZeroerrorsfrombeingdisplayedwherelineitemsareempty.The nextstepistodressuptheappearanceofthedatabywrappingandcenteringthetitles and adjusting the column widths so more data fits on the visible screen. Bolded fonts Page144

FormulasareaddedtodataexportedfromDynamicsGPtocalculateprofitandprofitpercentages.

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.

Page148

PivotTableReportfilteredfurtherbyColumntodisplaydataonlyselectedSalespersons.

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.

Fromhere,youcouldchooseadifferentcharttype,suchasanexploded3Dimensional Pie chart from the Change ChartType dialog box. You could also use the PivotChart DesignToolstoselectapredefinedchartlayoutusingtheChartGalleryshownbelow.

APivotChartProducedinExcel2007fromdataExportedfromDynamicsGP.

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.

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.

5. 6.

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

Next I drag and drop the CustomerName, CustomerBalance, and SalesPersonId fieldsontothepalettetocreatethefollowingPivotTablereport.

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

year. Also, Id like to make a million dollars profit I think thats a reasonablegoal. With just this little bit of data, we can work backwards based on Stephanies prior year financial statements and advise her as follows: Stephanieyourfixedcostsare$2millionandyouwanttomakeanother $1 million in profit. $3 million is 25% of your anticipated sales of $12 million,thereforeyouneedtopriceyourfurniturewitha25%marginto achieve the desired results. Further analysis shows that Stephanies furniture is currently priced at just 22% margin, which works out to a potentialprofitofjust$640,000.AtthispointwetellStephaniethestory aboutthegoodoleboyswhoweresellingonions.Itgoeslikethis: These two Florida boys were running up to Georgia and buying Vidalia onions at 4 for $1.00 which they then sold for a quarter a piece on the streetsofJacksonville.Aftersixmonths,oneboyturnedtotheotherand saidyouknow,Idontthinkweremakinganymoneywhatdoyou thinkweneedtododifferent?Theotherboythoughtrealhardandthen blurtedIthinkweneedabiggertruck. OK,itsanoldstory.Also,itsanexaggeratedstoryaswell.Butthereisalessontobe learnedhere.Ifyoudontpriceyourproductstomakeaprofit,youwillnevermakea profit.And,ifyoudontpriceyourproductstomakeyourdesiredprofit,youwillnever makeyourdesiredprofits.ThisTargetProfitMarginisarathereasycalculationforany CPAtomakeyetCPAsoftenfailtomakethissimplecalculation.Stillthereisanother issueinthatfluctuatingcostsmakeitalmostimpossibletohitthetargetedsalesprocess unlessyoumakedailypriceadjustments.Thisiswhereastrongaccountingsystemwill help. Inourexampleabove,StephanieshouldconsiderusingtheMarginPricingOptionin heraccountingsystemtoalwaysadjustpricestoreflectaprofitmarginof25%.Inthis manner, if her costs go up or down, her price will adjust accordingly to provide the desiredprofitmargin.TheresultisthatStephaniewillthenhavethechancetoachieve her goals. (There are of course, other factors at play that may prevent success, but without adequate pricing, Stephanie will have no chance at all of hitting her target thinkaboutit.)ThescreenbelowshowshowmarginpricingisappliedinDynamicsGP.

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

Biography & Contact Information


J. Carlton Collins, CPA , ASA Research, carlton@asaresearch.com, 770.734.0950 J.CarltonCollins,CPAisaCertifiedPublicAccountantwithexperienceintechnology,tax, auditing, accounting systems, financial reporting, and bond financing. He is an author, lecturer,andtechnology&accountingsystemsconsultant.Hehaspublishedmorethan two dozen books, two hundred articles, and thousands of web pages. As a public speaker,Mr.Collinshasdeliveredmorethan2,000lecturesin44statesand5countries addressing more than 500,000 business professionals, including numerous keynote lecturesatnationalandinternationalconferences.Keyawardsinclude:"AICPALifetime Achievement Award", "Tom Radcliffe Outstanding Discussion Leader Award", "GSCPA Outstanding Discussion Leader Award", and "Accounting Technologies' Top Ten CPA Technologists Award". As a consultant, Mr. Collins has assisted 275+ large and small companies with the selection and implementation of accounting systems. Mr. Collins has a Bachelors degree in AccountingfromtheUniversityofGeorgia,isa27yearmemberoftheAICPAandtheGeorgiaSocietyofCPAs,and isalsoalicensedrealtor. 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

Potrebbero piacerti anche