Professional Documents
Culture Documents
Excel Interactive Totals Chart: London
Excel Interactive Totals Chart: London
(http://www.contextures.com/index.html)
LONDON
YOUBELONGHERE.Booknowfrom3300/night.
airbnb.co.in
Introduction
WorkbookSetup
StarttheDashboard
AddtheAdmin_ListsSheet
AddtheDashboardCriteria
AddtheChart_DataSheet
LinkCheckBoxestoCells
AddFilterFormulasforData
GetMonthStartDates
AddFormulasforChartData
AddNamesforChartData
CreateaColumnChart
AddDynamicRangestoChart
TesttheRevisedChart
CreateaDashboardTitle
CreateaChartTitle
AddCriteriaLabelsonChart
TesttheInteractiveOnlineChart
DownloadtheWorkbook
MoreChartTutorials
http://www.contextures.com/excelchartsinteractivetotals.html
Introduction 1/23
3/31/2017 ExcelChartsInteractiveTotals
Introduction
Inthisinteractivechart,enteradatarangeonthedashboardsheet,selectcriteriafromtheRangeandCategorylists,thenclickthe
QuantityandPricecheckboxes,tocontrolwhichdataisshowninthechart.Thereisnoprogrammingrequired,justformulas.
Thistechniqueworksbestforsmalltomidsizedtables.Formulasareaddedtothedatatable,sotheworkbookwillslowdownifyou
havethousandsofrowsofdata.
Dashboard
Sales_Data
Admin_Lists
Chart_Data
Belowisabriefdescriptionofeachsheet,andtheformulasareexplainedinthenextsection.
Dashboard Sheet
Thissheethastheinteractivechart,checkboxestoshoworhidetheQuantityandPrice,andcellsforthedaterangeandcriteria.
ThereisaformulaincellB1,tocalculateacharttitle,basedonthestartandenddates.
http://www.contextures.com/excelchartsinteractivetotals.html 2/23
3/31/2017 ExcelChartsInteractiveTotals
Sales_Data Sheet
ThissheethasanamedExceltabletblSaleswithsalesorderdata.IncolumnsAtoEthereissalesdata,butnoformulas.For
eachsalesorder,wehaveanorderdate,region,category,quantityandtotalsaleprice.
NOTE:The"DataOnly"workbookhasthissheet,withthedatacolumns,andnoformulas.ItdoesnothavetheDashboard,
Admin_ListsorChart_Datasheets.
Inthecompletedworkbook,thereareformulasincolumnsFtoL,tocreatevaluesfortheinteractivechart.
http://www.contextures.com/excelchartsinteractivetotals.html
Admin_Lists Sheet 3/23
3/31/2017 ExcelChartsInteractiveTotals
Admin_Lists Sheet
Thissheethasatwolists,innamedrangesRegionListandCatList.Thoselistsareusedtocreatedropdownlistsforcriteria,onthe
dashboard.
Therearetwocellswithformulas,andthosecellsarealsonamed:StartYrMthandEndYrMth.
Chart_Data Sheet
Thissheethaslinkstothecheckboxes,andformulastocalculatethedaterangeandthetotalamountsforthechart.Dynamicnamed
rangesaredefined,andusedinthechartseries.
1.Insertanewsheet,andnameitDashboard
2.Typeheadingsforthecriteriacells:
B3:StartDate
D3:EndDate
F3:Region
H3:Category
3.Toidentifythecriteriaentrycells,formatcellsB4,D4,F4andH4withlightgreenfillandaborder
4.Makethecolumnsbetweenthegreencellsnarrower
http://www.contextures.com/excelchartsinteractivetotals.html 4/23
3/31/2017 ExcelChartsInteractiveTotals
Later,you'llusethesenamesinformulas:
B4:StartDate
D4:EndDate
F4:SelReg
H4:SelCat
1.OntheRibbon,clicktheDevelopertab.(Ifthetabisnotvisible,followtheinstructionshere,toaddtheDevelopertab
(http://www.contextures.com/xlfaqMac.html#developer))
2.ClicktheInsertcommand,andintheFormControlssection,clicktheCheckBox
3.Ontheworksheet,clickincellC6,toaddacheckbox.
4.Rightclickthecheckbox,andclickEditText,thendeletethecaptiontext.
5.Makethecheckboxnarrower,tofitincolumnC.
http://www.contextures.com/excelchartsinteractivetotals.html 5/23
3/31/2017 ExcelChartsInteractiveTotals
6.Rightclickthecheckbox,andclickCopy,thenpasteincellE6.
7.IncellD6,typeQuantityandincellF6,typePrice.
8.GototheViewtabontheExcelRibbon,andturnoffthegridlines.
NOTE:Youcouldadddatavalidationinthestartdateandenddatecells,toensurethatvaliddatesareentered,andtheenddateis
onorafterthestartdate.
1.Insertanewsheet,andnameitAdmin_Lists
2.TypeheadingsfortheNamedRanges:
B1:Region
D1:Category
F1:StartYrMth
F4:EndYrMth
3.IncellsB2:B3,typetheregionnames:East,West
4.IncellsD2:D5,typethecategorynames:Snacks,Cookies,Bars,Crackers
5.NamecellsB2:B3asRegionList
6.NamecellsD2:D5asCatList
7.NamecellF2asStartYrMth
8.NamecellF5asEndYrMth
http://www.contextures.com/excelchartsinteractivetotals.html 6/23
3/31/2017 ExcelChartsInteractiveTotals
Region List
TocreateaRegiondropdownlist:
1.OntheDashboardsheet,selectcellF4
2.OntheRibbon,clicktheDatatab,andclickDataValidation
3.FromtheAllowdropdown,selectList
4.ClickintheSourcebox,andpresstheF3key,toseealistofnamedranges
5.ClickonRegionList,thenclickOK
6.ClickOK,tocompletethedropdownlistofregions
Category List
TocreateaCategorydropdownlist:
1.OntheDashboardsheet,selectcellH4
2.OntheRibbon,clicktheDatatab,andclickDataValidation
3.FromtheAllowdropdown,selectList
http://www.contextures.com/excelchartsinteractivetotals.html 7/23
3/31/2017 ExcelChartsInteractiveTotals
4.ClickintheSourcebox,andpresstheF3key,toseealistofnamedranges
5.ClickonCatList,thenclickOK
6.ClickOK,tocompletethedropdownlistofcategories
StartDate:March1,2015
EndDate:June30,2015
Next,fillintheothertwocriteriacells:
ClickthearrowintheRegioncell(F4),andselectEast
SelectCookiesasthecategoryfromthedropdownlistincellH4
1.Insertanewsheet,andnameitChart_Data
2.Typeheadingsforthechartdata:
B3:ID
C3:DateRange
D3:Quantity
E3:Price
F3:MthEnd
3.IncellsB4:B39,makealistofnumbers,from1to36foramaximumof3yearsofdata
4.Toidentifythechartdatacells,selectcellsB3:F39andapplyan"AllBorders"border
5.Also,addborderstocellsD2andE2thesecellswillbelinkedtothecheckboxesonthedashboard
6.NamecellD2asLinkQty,andnamecellE2asLinkPrice
http://www.contextures.com/excelchartsinteractivetotals.html 8/23
3/31/2017 ExcelChartsInteractiveTotals
1.OntheDashboardsheet,rightclickontheQuantitycheckbox,andclickFormatControl
2.ClickintheCellLinkbox,andtypeLinkQtythenameofthelinkedcellontheChart_Datasheet.
3.ClickOKtoclosetheFormatControlwindow
4.ClickOKtoclosetheFormatControlwindow.
5.Next,rightclickthePricecheckbox,andlinkittotheLinkPricecell.
Totestthelinkedcells:
1.Clickeachofthecheckboxes,toremovethecheckmark,ifithasone
2.GototheChart_Datasheet,andeachofthelinkedcellsshouldcontain"FALSE".
3.GobacktotheDashboard,andaddacheckmarkineachcheckbox
4.NowthelinkedcellsontheChart_Datasheet,shouldcontain"TRUE".
NOTE:Ifyouclearthosecells,ortypeFALSE,itwillalsoclearthecheckboxes.
http://www.contextures.com/excelchartsinteractivetotals.html 9/23
3/31/2017 ExcelChartsInteractiveTotals
CellI2,tocheckiftherecordisintheselecteddaterange
=AND([@OrderDate]>=StartDate,[@OrderDate]<=EndDate)
CellJ2,tocheckiftherecordisintheselectedRegion,ornoRegionwasselected
=OR([@Region]=SelReg,SelReg="")
CellK2,tocheckiftherecordisintheselectedCategory,ornoCategorywasselected
=OR([@Category]=SelCat,SelCat="")
Are All 3 Criteria TRUE?
IncellL2,theformulacheckstoseeifall3criteriatestsareTRUE.Ifso,theSumthosecellswillbe3,whichmatchestheCountof
thosecells.
=(SUM(Sales_Data[@[SelDates]:[SelCat]])=COUNT(Sales_Data[@[SelDates]:[SelCat]]))
Theresultwillbe1ifallcriteriaareTRUE,and0ifnotallareTRUE.
Calculate the Quantity and Price
Inthefinaltwocolumns,theoriginalquantityandpricearemultipliedbythe1or0incolumnL.So,ifall3criteriaareTRUE,the
originalquantityandpricearereturned,otherwisetheresultis0.
CellM2,tocalculatetheQuantitybasedonselectedcriteria:
=[@Quantity]*[@AllOK]
http://www.contextures.com/excelchartsinteractivetotals.html 10/23
3/31/2017 ExcelChartsInteractiveTotals
CellN2,tocalculatethePricebasedonselectedcriteria:
=[@SalePrice]*[@AllOK]
1.OrderDateisinthedaterangeyouenteredontheDashboard.
2.RegionisEast
3.CategoryisCookie
BecauseallthreecriteriawereTRUE,thereisa1intheAllOKcolumn(L),andtheCalcQtyandCalcPricecolumnshowtheoriginal
amounts.
G2:=EOMONTH(StartDate,1)+1
G3:=EOMONTH(EndDate,1)+1
TheEOMONTHfunctiongetsthelastdateinamonth,basedonastartingdate,andoffsetbyaspecifiednumberofmonths.
IntheformulaincellG3:
thestartingdateisthevalueintheEndDatecell
thenumberofmonthsis1
OurenddateisJune30,2015,sothelastdayofthemonthbeforethatisMay31,2015
Then,theformulaadds1tothatdate,togetthefirstdayofthenextmonthJune1,2015.
http://www.contextures.com/excelchartsinteractivetotals.html 11/23
3/31/2017 ExcelChartsInteractiveTotals
GototheChart_Datasheet,andenterthefollowingformulas,tocalculatethedatesandquantitiesforthechartdata.
1.CellC4:=IF(StartYrMth="","",IF(B4=1,StartYrMth,IF(F3<EndDate,F3+1,"")))
2.CellD4:=IF($C4="","",IF(D$2=FALSE,NA(),SUMIFS(Sales_Data[CalcQty],Sales_Data[YrMth],C4)))
3.CellE4:=IF($C4="","",IF(E$2=FALSE,NA(),SUMIFS(Sales_Data[CalcPrice],Sales_Data[YrMth],C4)))
4.CellF4:=IF(C4="","",EDATE(C4,1)1)
Next,copyallfourformulasdowntotheendofthelist,inrow39.
Dates:TheDateRangecolumn(C)showsalistofmonthstartingdates,forallthemonthsintheselecteddaterange.
Quantity:IfD2isTRUE,thetotalquantityforeachmonthisshown,basedontheamountsintheCalcQtycolumnontheData
sheet.
Price:IfE2isTRUE,thetotalpriceforeachmonthisshown,basedontheamountsintheCalcPricecolumnontheDatasheet.
MonthEnd:TheMthEndcolumn(F)showsthemonthenddates,forallthemonthsintheselecteddaterange.
http://www.contextures.com/excelchartsinteractivetotals.html 12/23
3/31/2017 ExcelChartsInteractiveTotals
SelectcellC3,andnameitasChartStart
SelectcellsC4:C39,andnamethatrangeasChartDatesALL
1.OntheExcelRibbon,gototheFormulastab,andclickDefineName
2.IntheNamebox,enter:ChartData
3.IntheRefersTobox,typethisformula:=OFFSET(ChartStart,1,0,COUNT(ChartDatesALL),3)
4.ClickOKtocompletethename
TheformulausestheOFFSETfunction(http://www.contextures.com/exceloffsetfunction.html)tocreateareference:
ThisrangestartsincellC4,whichisonerowbelowtheChartStartcell.
ThenumberofrowsintherangeisbasedonthecountofdatesintheChartDatesALLrange
Thereare3columnsintherange,fortheDate,QuantityandPrice
ToseethecurrentrangeforChartData:
1.OntheExcelRibbon,gototheFormulastab,andclickNameManager
2.Inthelistofnames,clickonChartData
3.ClickintheRefersTobox,wheretheformulais
4.OntheChart_Datasheet,thecellsintheChartDatarangewillbeoutlinedwith"marchingants"(ascrollingmarquee)
http://www.contextures.com/excelchartsinteractivetotals.html 13/23
3/31/2017 ExcelChartsInteractiveTotals
Followthesamestepstodefinethese3names:
1.Name:ChartDatesFormula:=OFFSET(ChartData,,0,,1)
2.Name:ChartQtyFormula:=OFFSET(ChartData,,1,,1)
3.Name:ChartPriceFormula:=OFFSET(ChartData,,2,,1)
StartingfromtheChartDatarange:
theChartDaterangemoves0columnstotherightitstartsinthesamecolumnastheChartDatarange.
theChartQtyrangeis1columntotheright
theChartPricerangeis2columnstotheright.
Allthreerangeshaveawidthof1column,insteadofthe3columnsinChartData.
1.OntheChart_Datasheet,selectthevisibledataandheadingsinthetablecellsC3:E7
2.OntheRibbon,clicktheInserttab
3.ClicktheColumnChartcommand,thenclick2DClusteredColumnchart
http://www.contextures.com/excelchartsinteractivetotals.html 14/23
3/31/2017 ExcelChartsInteractiveTotals
4.Cutthechart,andpasteitontotheDashboardsheet.
However,theothercriteriawillworkcorrectly,soyoucantestthose:
ClickonthethePricecheckboxes,toaddacheckmark.ThePricecolumnswillappearinthechart
ChangetheRegiontoWest,toseetheCookiessalesinthatregion.
ChangetheCategorytoBars,toseetheBarssalesintheWestregion.
http://www.contextures.com/excelchartsinteractivetotals.html 15/23
3/31/2017 ExcelChartsInteractiveTotals
1.Clickthechart,toselectit
2.OntheRibbon,underChartTools,clicktheDesigntab
3.ClicktheSelectDatacommand
4.IntheChartDataRangebox,youwillseetheexistingformula,withitsstaticreferences:
=Chart_Data!$C$3:$E$7
http://www.contextures.com/excelchartsinteractivetotals.html 16/23
3/31/2017 ExcelChartsInteractiveTotals
5.Changetheformula,toreplacethecellreferenceswithrangenames:
=Chart_Data!ChartData
1.IntheLegendEntrieslist,clickonSeries1(previouslyQuantity)
2.ClicktheEditbutton,toopentheEditSerieswindow.
3.ClickintheSeriesNamebox,thengototheChart_Datasheet,andclickoncellD3.
4.IntheSeriesValuesbox,changetheformula,toreplacethecellreferenceswiththerangename:
=Chart_Data!ChartQty
5.ClickOK.
http://www.contextures.com/excelchartsinteractivetotals.html 17/23
3/31/2017 ExcelChartsInteractiveTotals
1.IntheLegendEntrieslist,clickonSeries2(previouslyPrice)
2.ClicktheEditbutton,toopentheEditSerieswindow.
3.ClickintheSeriesNamebox,thengototheChart_Datasheet,andclickoncellE3.
4.IntheSeriesValuesbox,changetheformula,toreplacethecellreferenceswiththerangename:
=Chart_Data!ChartPrice
5.ClickOK.
1.IntheSelectDataSourcewindow,intheHorizontal(Category)AxisLabelssection,clicktheEditbutton.
2.IntheAxisLabelswindow,changetheAxisLabelRange,replacingthecellreferenceswiththeChartDatesnamedrange:
=Chart_Data!ChartDates
3.ClickOK,toclosetheAxisLabelswindow,thenclickOKtoclosetheSelectDataSourcewindow.
Totestthedates:
ChangetheEndDateto5/31/15thechartshouldchange,toshowonly3months.
ChangetheEndDateto8/31/15thechartshouldchange,toshow6monthsofdata.
PasteinthefollowingformulaintocellB1:
="Sales:"&TEXT(StartDate,"ddmmmyyyy")&"to"&TEXT(EndDate,"ddmmmyyyy")
FormatcellB1inalarge,boldfont.Inthescreenshotbelow,Calibri14Boldisused.
http://www.contextures.com/excelchartsinteractivetotals.html 19/23
3/31/2017 ExcelChartsInteractiveTotals
Tolinkthecharttitletothedashboardtitle:
1.Clickonthechart'stitle,toselectit.
2.ClickintheFormulabar,andtypeanEqualSign(=)
3.ClickoncellB1,whichcontainsthedashboardtitle
4.PressEnter,tocompletetheformula
Thecharttitlewillchangefromthedefault"ChartTitle",andwillshowtheresultoftheformulaincellB1.
Youcanformatthecharttitle,ifyouwantadifferentfontorsize.
http://www.contextures.com/excelchartsinteractivetotals.html 20/23
3/31/2017 ExcelChartsInteractiveTotals
Toshowthecriteria,followthesesteps:
1.Clickonthecharttoselectit.
2.OntheRibbon'sInserttab,clicktheTextBoxcommand
3.Inanemptypartofthechart,dragtocreateasmalltextboxjustbigenoughtoshowtheregionname
4.ClickintheFormulabar,andtypeanEqualSign(=)
5.ClickoncellF4,whichcontainstheRegionname
6.PressEnter,tocompletetheformula
Repeatthesteps,toaddatextboxwiththeCategoryname,linkedtocellH4.
Then,movethetextboxes,orresizethem,ifnecessary.
Inthescreenshotbelow,Iaddedspacebelowthecharttitle,andmovethetextboxesthere.
http://www.contextures.com/excelchartsinteractivetotals.html
Download the Workbooks 21/23