Вы находитесь на странице: 1из 3

UsesforExcelsNA()inCharts

Tips&TricksForFinancialPlanning&Analysis

OnethingthatwefrequentlyseeclientsstrugglewithwhengeneratinglinegraphsusingExceliswhentheyplottwo linesthatdonotcoverthesamenumberofperiods.Forexample,ausermightwanttoplottherevenueplanforthe entireyear,showingthecumulativetrendover12monthsaswellasthecumulativemonthlyactualrevenue.Theissue thatweseeisreflectedinthegraphbelow.Becausethereisnodataforthefirstmonthbeyondthemostrecentmonth ofactualresults,thetrendlinedropsbacktotheXaxis(oritcouldextendthroughtheremainderoftheyearatthe currentyeartodatevalue).Frequentlytheissueisresolvedbyusersblankingoutthecellreferencesbeyondthecurrent month,whichcreatesanextramaintenanceheadacheeachmonthtoextendtheformulareferencingthelatestmonth ofactualresultstothenextcolumn.

Tosolvethisissue,youneedtomakeacoupleofsimplechanges.Thefirstchangerequiresthatyouaddadefinedcell thatindicatesthecurrentyeartodatemonth,whichwouldbethenumber5forMayinourexample.Theeasiestwayto createanamedcellistoplaceyourcursoronanavailablecell(hereweusedcellB1)andtypeanameintothetheName Box.Wewilluse"ME_Num"asourDefinedName.Youcanseeinthegraphicbelowthatwehavetyped"ME_Num"in theNameBox,withthecursoroncellB1andthenjusthitEntertocreatetheDefinedName.

OnceweputavalueincellB1,thevariableME_Numwillequalthatvalue.[IfyouareusingExcel2003,theprocessto defineacellnameisunchanged.WejustneedtotypethenameintotheNameBoxinthissamelocation.]Withthe DefinedNameestablished,wecanuseittorecordthecurrentmonthdate,whichisstill5forMay.


Tips&TricksforFP&A http://rpscgi.com/blog.aspx 2011ResourcePlanningSolutions

UsesforExcelsNA()inCharts

TipsandTricksforFinancialPlanning&Analysis

Inourexample,weareimportingthemonthlyvaluesforboththeplanandactualdataintorows34and35,respectively. Wewanttosetasideanareathatthelinegraphwillreferencethatisseparatefromthelocationusedtoimporttheplan andactualresults.Wehaveusedrows31and32forthecumulativeplanandcumulativeactual,respectively,asshown inthegraphicbelow,togenerateourtrendgraphs.Theoriginalformulaforreferencingthecumulativeyeartodate actualdatawasjustasimpleSUM()function,thatusedanabsolutereferencetothefirstmonthorJanuaryincolumn "C"(forexampletheFebruaryformulawas=SUM($C35:D35).WhatwewanttodonowisaddanIF()functiontolimit howmuchdataisplottedonourExcelgraph.Ifwedonotwantadatapointplottedonourtrendline,wewillreturnthe ExcelconstantNA().NothingwillbereferencedontheExcelgraphwhenanNA()isencountered. UsingthesamecumulativeactualcellforFebruary,wewouldchangetheformulaatcellD32tothefollowing: D32=IF(ME_Num<=2,SUM($C35:D35),NA()). InJanuary,theME_Numvariablewouldbeequaltoone,whichmeansthatourformulaforFebruary,atcellD32,would returnNA().ButbeginningwiththeFebruaryresultsandeverymonththereafter,the=SUM($C35:D35)wouldproduce theactualresultforyeartodateFebruary,becauseME_Numwouldbegreaterthan2.WithME_Numsettoequal5, ouroriginalchartnowappearsasshownbelow.YoucanseethatourME_NumvalueatcellB2issetto5,thatwehave actualcumulativedatathroughMayandtheNA()constant(actuallyitisshownbelowas"NA#")isdisplayedfromJune throughDecemberandourcumulativeactualtrendlinestopsatthe5thmonth,whichwasthegoal.

Forjustonechart,thismayseemoflittleconsequence.Butifyouwantedtoreference5differenttrendgraphs(e.g. revenue,grossprofits,operatingprofitandnetprofit)usingthesamechart,thenthisapproachreallystartstomake sense.Youcouldcombinethe5chartsintooneusingtheCHOOSE()functiontoswitchthegraphdatasource.This techniquewouldworkjustaswellifyouwantedyouruserstobeabletoswitchbetweenlineofbusiness1,lineof business2andtheconsolidatedbusinessbyjustchangingthevalueinonecell. Toaccomplishthistechnique,wearegoingtocreateanewDefinedName,called"Chart_Num,"atcellC1.Assuming thatouractualsalesdataareatrow35,grossprofitat45,operatingprofitatrow55andnetincomeatrow65,we wouldchangeouroriginalformula,fortheFebruaryactualgraphdatapoint,tothefollowing:


Tips&TricksforFP&A http://rpscgi.com/blog.aspx 2011ResourcePlanningSolutions

UsesforExcelsNA()inCharts

TipsandTricksforFinancialPlanning&Analysis

D32=IF(2<=ME_Num,CHOOSE(Chart_Num,SUM($C35:D35),SUM($C45:D45),SUM($C55:D55),SUM($635:635)),NA()) Intheexampleabove,wehavenestedtheCHOOSE()functioninsidetheIF()statement.TheCHOOSE()functionusesthe valueof"Chart_Num"todeterminewhichrowofactualdatatosumandreferenceinthechart.If"Chart_Num"isequal toone,thentheSUM($C35:D35)formulawillbeevaluated,whichcorrespondstotheyeartodatesalesforFebruary.If "Chart_Num"isequaltotwo,thentheSUM($C45:D45)formulawillbeevaluated,whichcorrespondstotheyearto dategrossprofitforFebruaryandsoon.Withthisstructure,youonlyneedtoupdatetheME_Nummonthlywhenyou importthenextmonth'sresultsandchangeChart_Numtoswitchthroughthetrendlinesforallyourkeymetrics.Ina futureblog,wewillexplorehowtosetupadropdownboxtoallowyouruserstoeasilychangethedisplayedmetrics. Clickheretodownloadtheexample

Tips&TricksforFP&A

http://rpscgi.com/blog.aspx

2011ResourcePlanningSolutions

Вам также может понравиться