microsoft excel and sanet.me

160

Upload: sheb2004

Post on 19-Feb-2016

47 views

Category:

Documents


0 download

DESCRIPTION

EXCEL

TRANSCRIPT

Page 1: Microsoft Excel and Sanet.me
Page 2: Microsoft Excel and Sanet.me

Contents

©MichaelOlafusi2014

Preface

MicrosoftExcel:It’smorepowerfulandeasierto…

HowExcelHandlesWhatYouType

DataConsistency,startingwiththeendinview

BuildingDatasheetsthatcaneasilyscale

Sorting

Filtering

DataCleaning

DataFormatting

Charts

PivotTableandPivotChart

BusinessDataAnalysis

PowerExcelFormulas

NamedRange,GoalSeekandScenarioManager

IntroductionToExcelVBA(macros)

Page 3: Microsoft Excel and Sanet.me

Copyright©2015MichaelOlafusi

Publishedby

www.urbizedge.com

Allrightsreserved.Nopartofthispublicationmaybereproduced,distributed,ortransmittedinanyformorbyanymeans,includingphotocopying,recording,orotherelectronicormechanicalmethods,withoutthepriorwrittenpermissionofthepublisher,exceptinthecaseofbriefquotationsembodiedincriticalreviewsandcertainother

noncommercialusespermittedbycopyrightlaw.

[email protected]

Page 4: Microsoft Excel and Sanet.me

Preface

MicrosoftExcelistheworld’smostusedbusinessintelligencetool.ItsknowledgeisevencompulsoryforanMBAdegreeandthebusinessworlddependsgreatlyonit.

ThisbookisaimedatmakingyouverygoodinMicrosoftExcelforbusinessdataanalysis,teachingyouwithcompanionvideosandpracticefilesthatcanbeaccessatwww.urbizedge.com/about(bottomofthepage).It’sintendedforSalesManagers,FinancialAnalysts,BusinessAnalysts,DataAnalysts,MISAnalysts,HRExecutivesandfrequentExcelusers.

ItiswrittenbyMichaelOlafusiatwotimeMicrosoftExcelMVP(mostvaluableprofessional)andafull-timeMicrosoftExcelconsultant.HeisthefounderofUrBizEdge,abusinessdataanalysisandMicrosoftExcelconsultingfirm.HehastrainedhundredsofbusinessprofessionalsonMicrosoftExcelandhasusedtheexperiencegainedfrominteractingwiththembothduringsuchtrainingsandwhileconsultingforcompaniestowritethisexcellentguideforthebusyprofessionalwhoneedstheimprovedworkproductivityMicrosoftExcelprovides.

Ifyoufeelanypartofthisbookcanbebetterimprovedorexpanded,[email protected]

Page 5: Microsoft Excel and Sanet.me

MicrosoftExcel:It’smorepowerfulandeasiertousethanyouthink!

We’vegotHomemenu,Insertmenu,PageLayoutmenu,Formulasmenu,Datamenu,ReviewmenuandViewmenu.Eachofthesemenuswillbediscussedinpracticalterms.

Theothermenus—Developermenu,LoadTestMenuandPowerQuerymenu—arenotdisplayedbydefault.IenabledthemasIdoalotofprogrammingandotheradvancedstuffinExcelwhichIneedthemfor.

HomeMenu

Page 6: Microsoft Excel and Sanet.me

ThehomemenuisExcel’smostusedmenu.Ithasverystraightforwardsub-menus.

Clipboard:Allowsyoutocopy,cutandpasteinExcel

Font:Allowsyoutosetfontsize,color,backgroundcolor(fill)&turnonboldoritalicsorunderline.

Alignment:Allowsyoutosetthepositionofwhateveryou’vetyped(orcopied)intoExcel.Italsoallowsyoutosethowit’swritten:horizontal,verticalorslanting.

Number:AllowsyoutosethowanumberisshowninExcel:regularnumber,currency,scientific,percentage,fraction…

Styles:AllowsyoutosettheformatofanExcelcellbasedonthedataitholds(conditionalformatting).Italsoallowsyoutoconvertaselectionofcellstotable,andtosetquickformatsforacell.

Cells:Allowsyoutoinsertnewcells,deletecellsandchangecellformat.

Editing:IthousestheveryusefulSortandfiltertools.AndalsoFind&Select,Find&Replace.There’salsoAutoSumwhichhelpsyousumallnumbersinaselection.

InsertMenu

TheInsertmenuhousessomeofExcel’sbesttools.

Tables:AllowsyoutoinsertPivotTable,PivotChartandTable.InsertingatableinExcelallowsforquickformatting,andbetterformulas(vianamedranges).PivotTableandPivotChartwillbediscussedlater.

Illustrations:Allowsyoutoinsertimagesandshapes.

Page 7: Microsoft Excel and Sanet.me

Charts:Allowsyoutoinsertcharts,whichwillbespeciallydiscussedlater.

Tours:HousesMapwhichtakesyoustraighttoPowerMap.PowerMapispartofMicrosoft’snewPowerBI.Itenablesyoumakegeo-mapsandcreateamazingdatavisualizationtours.

Reports:LetsyouaccessPowerView,anotherPowerBItool.PowerViewallowstocreateadatamodel,loadingupmanydifferentdatabasesandcreatinganalysisthatcutsacrossallthedatabases,allowingyoutoseeinsightsthatarebeyondasingledatabase.

Sparklines:AllowsyoutoinsertchartsthatfitintooneExcelcell.Theymakesomereportsbeautifulandeasytoread.

Filter:Allowsyoutofilteroutfieldvaluesyouarenotinterestedin.

Links:Allowsyoupointacellcontenttoawebsiteoranemailaddress.

Text:Allowsyoutoinserttextsandobjects(prettymuchanything,includingaPDFdocument)

Symbols:Allowsyoutotypeoutequationsandspecialsymbols.

PageLayoutMenu

ThePageLayoutmenudoesjustthat:settingupyourExceldocument’spagelookandforprinting.

Themes:It’snotoftenused;itsetsthelookoftheExcelwindowitself.

PageSetup:Itallowsyoutosethowthepagecomesoutwhenprinted.MostusedaretheOrientation(tosetasPortraitorLandscape)andPrintArea(toselectonthecellsyouwanttoprint).

ScaletoFit:Itallowsyoutosethowmuchisprintedperpage.MostfrequentuseistoforceExceltoprintononepage,orfitallthefields(columns)ononepagewidth.

SheetOptions:Youwouldn’twanttochangethedefault.ItallowsyousetwhetherExcelgridlinesbeprintedornot,andheadingstoo.Defaultisno/off(unticked).

Arrange:Itletsyourearrangeoverlappingobjects(shapes,images,textboxes…).Or

Page 8: Microsoft Excel and Sanet.me

alignthem.

FormulasMenu

TheFormulasmenugivesyouaccesstoExcel’sbuilt-informulas.

FunctionLibrary:Ithastheformulasgroupedbycategory.Onceyouhaveanideaofwhatyouwantdone,ithelpsyoulocatetheformulatouse.It’sgoodtolookthroughitonceinawhiletohaveanideaoftheout-of-the-boxanalysisExcelcando.

DefinedNames:Letsyounameacellorselectionofcells.Canbeveryusefulwhenanalyzingabigdatabaseorbuildingamodel.

FormulaAuditing:Allowsyoutocheckforerrorsinyourformulas,traceformulacellsandseehowyourfinalresultisbeingcalculated.

Calculation:AllowsyoutosetwhentheformulasinyourExcelsheetarecalculated:automatic(wheneveracellvaluechanges)ormanual(atfirstentryandwhenyouforcethemtoberecalculated).

DataMenu

TheDatamenuallowsyoutoworkwithexternaldataanddobasicdataformatting.

GetExternalData:Itallowsyoutoimportorlinktoanexternaldatafile(non-Excelfile).You’lluseitwheneveryouhaveadataintextfileandneeditworkedoninExcel.

Page 9: Microsoft Excel and Sanet.me

Connections:Allowsyoutomakechangestotheconnections/linkstoanexternaldatafile.Orforcearefreshoftheconnectionstocapturechangesmadeintheexternaldatafilesincelastconnection.

Sort&Filter:Allowsyoutosortdataanddosomefilteringtoo.Filterallowsyoutospecifyvaluestodisplay.

DataTools:Allowsyoudoverybasicdataanalysis.Especiallyremovingduplicateentries,andsplittingonefieldintoseveral(text-to-columns).Exampleissplittingfullnameintofirstnameandlastname.

Outline:Allowsyoutogroup(andhide)severalrows.Usefulforlargedatareportswithfewcategories;helpstogroupcategories.

Analysis:ThisisonlyvisibleafteryouenableDataAnalysisadd-inorSolveradd-in.Itallowsyouaccessalargecollectionofstatisticalanalysistoolsandmodelling.

ReviewMenu

TheReviewmenuisforspellchecks,commentingandsettingaccessrestrictions.

Proofing:Allowsyoutocarryoutspellchecksandwordmeaningchecks.

Language:AllowsyoutotranslatetheExcelfilecontentfromonelanguagetoanother.

Comments:AllowsyoutoincludecommentsinanExcelsheet,viewallcommentsatonceordeletecomments.

Changes:AllowsyoutosetaccessrestrictionsandtrackchangestotheExcelfile.Alsoallowsyoutosharethefile.

ViewMenu

TheViewmenuallowsyoutochangethewindowlayoutoftheExceldocument.Itdoesn’tchangeanythingintheactualdocument,justthewayit’sdisplayed.

Page 10: Microsoft Excel and Sanet.me

Workbookviews:Allowsyoutosethowtheworkbook(Excelfile)isdisplayed.

Show:Controlswhatnon-printingdetailsareshown:Gridlines,Headings,FormulabarandRuler.Theoneyou’llbeinterestedmostinisGridlines.IfyouwantyourExcelsheettolookmorelikeaWordfile,unticktheGridlines.That’swhat’sdonetoeveryExcelsheetyouseethathasnoGridlines.

Zoom:Doeswhatitsays:setszoom.

Window:Allowsyoutofreezeheaderssowhenyouscrolltheywillneverbeoutofview.AndalsoallowsyoutosplittheExcelsheetdisplay,soyoucancomparetwodifferentpartsofthesheet.

Macros:AllowsyoutoseethemacrosprogrammedintheExcelfile(ifthere’sanymacroinit).Showsonlywhenthedevelopermenuisenabled.

Page 11: Microsoft Excel and Sanet.me

HowExcelHandlesWhatYouType

InExcel,youtypeintosmallrectangularboxescalledcells.IwouldbereferringtoeverythingyoutypeorcopyintoExcelcellsasData.

Everycellhasanaddress,becauseeachcellisanintersectionofarowandacolumn.Thecellselectedintheimagebelow,isaddressedascellA1.ItistheintersectionofcolumnAandrow1.AcollectionofmillionsofthesecellsmakeanExcelsheet.AndanExcelfile(alsoreferredtoasExcelworkbook)isacollectionofoneormoreExcelsheets.

Sometimes,whatyoutypeintoacelltakesmorespacethanthecellhas.Don’tworry,justexpandthecolumnwidthbydraggingtherightborderofthecolumnheader.

Likethis:

Page 12: Microsoft Excel and Sanet.me

DifferentDataTypesinExcel

Excelrecognizes4differentdatatypes:Text,Number,Boolean&Formula.AnythingyoutypeintoExcelwillfallunderoneofthese.

Text:Wheneveryoutypealphabets,oramixofalphabetsandnumbersintoExcel(withoutproceedingwith=),everythingisrecognizedastext.Bydefault,Excelalignstexttotheleftofthecell.

Page 13: Microsoft Excel and Sanet.me

Number:Ifallyoutypeintoacellaredigits,theyarerecognizedasNumberbyExcel.Bydefault,Excelalignsnumbertotheright.

Boolean:FALSEandTRUEareBooleanentries.You’llhardlyusethem.Theyareusedforsettingupcomplexformulas.Bydefault,wheneveryoutypefalseortrueinacell,Excelwillputitinuppercaseandalignittothecenter.

Formula:Onceyoubeginacellentrywith=,Exceltreatseverythingyoutypeafterasaformula.

Page 14: Microsoft Excel and Sanet.me

Asarecap,seetheimagebelow.

ThepracticalimportanceofthisisthatifyoureceiveasalesreportinExcelandthenumbersarealignedtoleftinsteadofrightyoushouldbeconcerned.Therearethreereasonsthiscanhappenandtwoofthosereasonswillcausesomeofyourmathematicalformulastonotworkcorrectly.Youwouldn’twanttodoanincorrectanalysis,soit’sbesttocheckwhythenumbersarealignedtotheleftandnottotherightasexpected.

Page 15: Microsoft Excel and Sanet.me

1. Itcouldbethattheauthorforcedthenumberstoaligntotheleft.Tofindoutifthat’sthereason,checkthealignmentunderHomemenu.

2. Itcouldbethattheauthorforcedthenumbertobetreatedastextbysettingthecellformattotext

3. Itcouldbethattheauthorprecededthenumberwithasingleapostrophe(’)beforetypingthenumber.ThisisatricksavvyusersusetoforceExceltokeepthezerosatthebeginningofyourphonenumberorbankaccountnumber.Unfortunately,itforcesExceltotreatthecellentryasatextandalignittotheleft.

Page 16: Microsoft Excel and Sanet.me

Outofthesethreewaysofmakinganumbershowasalignedtotheleft,onlythefirstoneleavesthenumberintact.Theotherwaystransformthenumbertotextandwillgiveyouissueswhenyouincludethemincalculationsthatnormallywouldworkonnumbers.

NowyouhaveanideaofhowusefulanunderstandingofthedefaultwaysExceltreatthedifferentdatatypescanbeinyourdaytodayuseofExcel.

Page 17: Microsoft Excel and Sanet.me

DataConsistency,startingwiththeendinviewExcelisdifferentfromeveryotherMicrosoftOfficeprogramyouuse.Mostofthedocuments,reportsandanalysisyoudowithExcelwillbeusedsomedayinthefutureforanotherreportoranalysis.

TobecomeanexpertinExcel,youhavetoalwaysworkwiththeendinmind.YouhavetocreateyourExceldocumentsinsuchawaythatyoucaneasilyusethemforsomebiggerreportsinthefuture.AndtherearesomegeneralrulesI’llrecommendyouworkwithtoachievethis.

1.AlwaysuseacompacttablestructureforenteringyoucoredatainExcel.Thismeansusingtheminimumnumberofrowsandminimumnumberofcolumns.Exampleofacompacttableandnon-compacttableisshownbelow:

Sametablebutnotcompact,shownbelow.

Page 18: Microsoft Excel and Sanet.me

Inthenon-compacttableexample,youcandeleterows37and38withoutdeletinganydatainthetable.

2.Usedescriptivenamesforyourcolumnheadersandrowheaders.

Beasdescriptiveaspossibleinnamingthefieldsinyourtable,makeiteasyforanyonewhowillviewyourtabletounderstandtheinformationitconvenes.

Belowisatablewithfieldnamesthataredescriptiveenoughforanyonetounderstandtheinformationthetableconvenes.

Page 19: Microsoft Excel and Sanet.me

Belowisatablethathasheadersthatarenotdescriptiveenough.It’shardtofigureoutthespecificinformationinthetable.Isitatableofrevenueorexpense?Arethecompaniesclientsorsuppliers?Whatyeardothemonthsrepresent—January2014orJanuary2015?Whomeveryousendthisreporttowillcallyoubackforadetailedexplanationofwhatyouintendedtoreport.

Page 20: Microsoft Excel and Sanet.me

3.NameyourExcelsheets

Don’tjustgoaheadwiththedefaultnames—Sheet1,Sheet2,…—renamethesheetstoreflectthecontentsofthesheet.Thismakesyourworkbetterorganizedandfutureusemoreconvenient.

Torenameasheet,rightclickonthesheetname(thedefaultnamesareSheet1,Sheet2,…)andselectrename.Andasyouseeabove,youcanchangethecolorfromthedefaulttoo.

Page 21: Microsoft Excel and Sanet.me

4.AlsousedescriptivenameswhenrenamingtheExcelsheets.

5.AvoidputtingtoomanytablesinoneExcelsheet.Besttokeepjustrelatedtablesinthesamesheetifyoumustputmorethanonetableinthesheet.Itmakesnamingthesheeteasyandstraightforward.

6.UsesamenamingconventionsandtablestructureacrossallsimilarExcelfiles,especiallyweekly,monthlyandyearlyreportsofthesamedata.

7.Don’tuseCAPSexcessively.Itmakesyourreportsveryunprofessional.

Page 22: Microsoft Excel and Sanet.me

BuildingDatasheetsthatcaneasilyscale

Occasionally,youwillhavetoworkonatablewhosedatagrowscontinually.Wecanrefertosuchtablesasdatatables.Alltablesholddataandcantechnicallybereferredtoasadatatable,butinthisbookwewillrefertoalltablesasjusttablesandlimitthetermdatatabletoonlytablesthatgrowperpetually.

AnexampleofsuchatableisanEmployeeRecordtable.Aslongasthecompanyexiststhetablewillkeepgrowingandevenifthecompanyaimstonothaveovera100employees,therewillalwaysbeoldemployeesleavingandnewonestakentoreplacethem.Andtheyallhavetobecapturedintheemployeerecordtable,noemployee’srecordisdeletedwhenheleaves,there’sonlyafieldaddedtocapturehisresignation.

Therearesomepeculiarwaysoftreatingadatatable.

1.Haveonlyonedatatableonasheet.Sinceadatatableisatableyouexpecttogrowovertime,havingonlyoneonasheetletsyouhaveaccesstoalltherowsandthecolumnsintheExcelsheet.

2.StartadatatableasclosetocellA1aspossible.Again,thisistoaffordyouthemaximumspaceinthesheetforyourgrowingtable.

3.Avoidmeaninglessgapsinthedatatable.Makeitascompactaspossible.

4.Arrangethefieldssuchthatthemostimportantorbasicfieldscomefirst.Forexample,inanEmployeerecordtable,nameshouldcomebeforecontactaddress.

Page 23: Microsoft Excel and Sanet.me

5.Haveafieldforeverymeaningfulchunkofdata.Itisbettertohaveseparatefieldsforfirstnameandlastnamethanhaveonefieldholdboth.

6.Avoidmergingcellsinadatatable.Itisbettertorepeatcellentriesthanmergethecells.Mergedcellsaren’tformulafriendly.

Andasabonus,avoidhidingrowsandcolumnsinthedatatable.Thiswillsaveyoualotoffutureheadaches.

Page 24: Microsoft Excel and Sanet.me

SortingSortingisoneofthemostfrequenttaskwedoinExcel.Sortingletsyoure-arrangedatainalphabeticalorder,lowesttohighest,highesttolowest,andevenbycellcolor.

Weareusedtohavingdataarrangedinaparticularorder—AtoZ,JanuarytoDecember,1to10,andsoon.

Belowisanexampleofatablethathasitsrecordshaphazardlyarranged.Thestatesarenotarrangedalphabeticallyandthemonthsarenotinthenaturalorder.

First,let’shavethedatasortedbyStatealphabetically

Belowaretherecommendedstepstosortingatable.Selectthetable,gototheHomemenuandclickonSort&Filter.

Page 25: Microsoft Excel and Sanet.me

Thesortingdialogboxcomesup.

Thisdialogboxallowsyoutoaddmorethanthedefaultonelevelofsorting.

Select“State”intheSortbyboxandAtoZintheOrderbox.

Page 26: Microsoft Excel and Sanet.me

Theresultisshownbelow.

Youcanaddanextralevelofsortinginthesortingdialogbox.Thiswouldbeusefulinsortingtableslikeanationalpopulationcensustable.Youmightwanttosortfirstbystate(fromAbiatoZamfara)andthenanextralevelofsortingbyLocalGovernmentAreas.Soyou’llhaveasettingsimilartotheonebelow

Page 27: Microsoft Excel and Sanet.me

Nextistosortthemonthsinthenaturalorderweareusedto—JantoDec.Thiswillrequireatypeofsortingcalled“LefttoRight”asagainsttheonewejustdid,called“ToptoBottom”.

Sotogetthisdone,weselectthetablestartingfromthefirstmonthtothelastmonth.Wewillleavethestatefieldoutbecausewewantittoremaininthepositionitis.

Thenselecttherowthemonthsareon(Row2)andsettheordertoOldesttoNewest.

Page 28: Microsoft Excel and Sanet.me

Belowistheresult.

Page 29: Microsoft Excel and Sanet.me

Filtering

FilterisoneoftheExcelpoweruser’smostusedtool.Itallowsyouselectivelychoosewhatyouwanttoviewinatableandhidetherest.

ItisveryeasytoaccessandcanbeaccessedfromthreedifferentplacesinExcel.

ByrightclickingandselectingFilter.

FromtheHomemenu,clickingonSort&Filterattheright.

Page 30: Microsoft Excel and Sanet.me

FromtheDatamenu.

Onceyou’veturnedontheFiltertoolbyclickingonit,youwillseeadropdownboxbesidetheheadersofthetable.

Page 31: Microsoft Excel and Sanet.me

Clickingonthedropdownboxshowsyoualltheuniqueitemsinthatfieldandyoucanselecttheonesyouwanttoview(hidingtherest).Bydefault,allitemsareselectedsoyouwillhavetounselecttheonesyoudon’twanttosee.

Inthescreenshotbelow,allthepizzaitemswereunselectedexcepttheBBQChicken(meaningonlyBBQChickenwasselected).

Page 32: Microsoft Excel and Sanet.me

Noticethebluerownumbers,itisExcel’swayofvisuallyhintingyouthatsomerowshavebeenhiddenastheydidnotcontaintheitemswewanttoview.

Filteringisthatsimpleandstraightforward.

Page 33: Microsoft Excel and Sanet.me

DataCleaning

AlotoftimesthedatayouaregiventoworkoninExcelisnotinaformatusableforyouandneedsomecleaningbeforeyoucangoaheadwiththeanalysisyouintendeddoingonit.Inmostcasesyouhavetomanuallycleanthedataandfixwhateverissuesithasonebyonebeforeprogressingwiththeoriginalanalysisyouintendedtodoonthedata.

Fortunately,Excelhassomeniftytoolstohelpyouautomatesomeofthisdatacleaningprocess.Themostcommononesare,

Removingduplicates,andTexttoColumns

Thenwe’llcoveraspecialtoolthatcanhelpyoudoaquickcategorizationofyourdata:Subtotal.Finallywe’llcoverDataValidation,aningenioustoolforreducingdataentryerrorsinyourExcelfiles.

RemovingDuplicates.

Occasionally,youwillhaveatableandyou’llwanttoremoveduplicateentries.Ifitwereasalestransactiontable,youmightwanttoremovetheduplicatesalesentries.Intheexamplebelow,itisatableofitems(Pizzas)andwewanttoremovetheduplicateentriesleavingonlyuniqueentries.

Page 34: Microsoft Excel and Sanet.me

Asillustratedabove,youselecttheentirerecordsfirstandthengotoDatamenu,clickonRemoveDuplicates.Youwillgetaconfirmatorydialogbox.ClickonOK.

You’llseearesultshowingthenumberofduplicatevaluesthatwerefoundandthenumberofuniquevaluesfound.Basically,whatRemoveDuplicatesdoesisitleavesone

Page 35: Microsoft Excel and Sanet.me

recordofeachitemandremovesalltheextrarecordforthatitemthatitfinds.

Whenyouselectatablewithmorethanonefieldentry,theRemoveDuplicatesremoveonlytheentriesthathavesamevalueinallthefieldsasapreviousentryexceptyouspecifywhichfieldstoexcludeinthesearchforduplicates.

Inthescreenshotbelow,weexcludedCarSalesfromthefieldstoincludeinthesearchforduplicates.Sorowsthathavethesameentriesinalltheotherfieldswillbedeletedexceptone.

Page 36: Microsoft Excel and Sanet.me

TexttoColumns

Therewillbetimesyouwillhavedatayouwouldprefersplitacrossmultiplecolumnssqueezedintoonecolumn.ThishappensalotwhenyoucopydatafromanexternalsourceintoExceloryouopenanexporteddatafromotherbusinesssoftwarelikeCRMsandERPs.

Excel’sTexttoColumnstoolisthemagictoolforsplittingsuchdataentriesintomultiplecolumnsprovidedthereisarecognizablecharacterseparatingeachfieldortheyhavefixedlengthsperfield.BelowisasimpleexampleforsplittingafullnameinonecolumntofirstNamecolumnandlastNamefieldcolumn.

Page 37: Microsoft Excel and Sanet.me

Delimitedistheoptiontospecifythatthereisarecognizablecharacterseparatingeachfield.Inthisexample,thereisaspaceseparatingeveryfirstnamefromthelastname.

Page 38: Microsoft Excel and Sanet.me

NoticehowExcelshowsalinebetweenthefirstnamesandthelastnamesonceyouselecttheappropriatedelimiter(space,inthiscase).ClickonNextandFinish.

Belowistheresult.Justasdesired.

Subtotal

Page 39: Microsoft Excel and Sanet.me

SubtotalisasecrettoolfordoingaquickanalysisofatableinExcel.Itbreaksthedatadownbycategoriesandcreatesgroupingthatshowsyoudifferentlevelsofdetails.

Itisalsoveryeasytouse.

Belowisanexamplewherewe’lluseit.

Itisamarketresearchdatatableshowingthedifferentcarmakesoldinthreedifferentautodealerships.

Wecanapplyasubtotaltothistoseesomeinterestinganalysis.

Page 40: Microsoft Excel and Sanet.me

Selectthetable,gotoDatamenuandclickonSubtotal.Inthedialogboxthatcomesup,inthe“Addsubtotalto”sectiontickallthefieldsthathavenumericvalues(exceptyoudon’twanttoseeanumericanalysisofthem).

OnceyouclickonOK,yougetaresultthatlookslikethefollowing—

Level1:

Page 41: Microsoft Excel and Sanet.me

Level2:

Level3:

Page 42: Microsoft Excel and Sanet.me

Andthebestpartisthatyoucanremovethesubtotalandhaveyouroriginaltabledatabackjustasitwasbefore.ToremoveisaseasyasclickingtheSubtotalagainandclickingonRemoveAll.

Page 43: Microsoft Excel and Sanet.me

Seetheresultbelow.Allthelevel1,2&3groupingsgone.

DataValidation

ThisisanothersecretbutpowerfultoolinExcel.IthelpsyouputinplacesomeerrorcheckmechanismandcanbeusedbyaskilledExcelusertomakepowerfulExceldashboards.

Let’sseesomeofthecommonusesofit.

ThetablebelowisanEmployeerecordstable.Initwewanttoforcepeopletoenterjustdepartmentsspecifiedattheleftofthetable.Infact,wewantthemtohavetheeasyoptionofseeingapre-populateddropdownlistandpickadepartmentfromthelistoptions.

Page 44: Microsoft Excel and Sanet.me

Weselectthecellswewanttogivethisfunctionality,gotoDatamenuandclickonDataValidation(sometimestwice).

You’llseethattherearemanyoptionstopickbetween.

Page 45: Microsoft Excel and Sanet.me

1. AnyValue.Thisisthedefaultanditissameasnothavinganydatavalidation.Theusercanenteranyvalueintothecell.

2. WholeNumber.Thisforcestheusertoenteronlynumericvaluesthatarewholenumbers.Iftheuserentersatextordecimalentryhe’llgetanerror.Thismightbeapplicableinaninvoicesheet,forthecellsthatholdtheorderquantityifyoudon’tsellfractionofyourproducts.

3. Decimal.Thisforcestheusertoenterawholenumberordecimalentry.Awholenumberissameasadecimalwithzerosafterthedecimalpoint.Thismightbegreatinafinancialmodelsheet,toholdvaluesofgrowthassumption,exchangeratesandriskpremiums.

4. List.Thisistheonewearemostinterestedin.Itenablesustolimitthecellentriestoalistofoptions.Wewillusethisintheexampleunderreview.

5. Date.Thisforcestheusertoenteravaliddateentry.6. Time.Thisforcestheusertoenteravalidtimeentry.7. TextLength.Thisallowstheusertoenteranyvalueaslongasthecharacterlength

isnotmorethanthespecifiedvaluehere.Itisgoodforfieldsthatholdphonenumbers,maybeyouwanttolimittheentrytothe+234812345678914characterslongentryformat.

8. Custom.Justasthenamespecifies,youwanttolimitthecellentrytosomethinglessconventionalandnotcoveredbytheotheroptions.

InthisexamplewearegoingtousetheListoption.Solet’sselectit.

Page 46: Microsoft Excel and Sanet.me

OnceyouclicktheicononthefarrightcorneroftheSourcebox,selectentriestolimittheusersto.InthiscasewehavetypedoutthelistoptionsincellsG2:G6,holdingthedifferentdepartments.

Page 47: Microsoft Excel and Sanet.me

Andit’sdone.

Theuserisforcedtochoosebetweentheoptionsinthelist.Heevenseesadropdownarrowthatexpandstoadropdownliststhemomenthetriestofillthecell.

AndthatishowDataValidationworks.Whenusedcreativelyitcansaveyoufromthestressofmakingcorrectionstoformspeoplefilledandcanbeusedinconjunctionwith

Page 48: Microsoft Excel and Sanet.me

formulaslikeVLOOKUPtomakeadynamicreportanddashboards.

Page 49: Microsoft Excel and Sanet.me

DataFormatting

TherearesomequicktipsinExcelthatwouldturnablandlookingdataintoanicelookingone.Oneofthebesttipistoapplyatableformattingtothedata.

Anexample,istakingatableliketheonebelowandturningitinawellformattedone.

SelectthedataandgotoHomemenu,FormatasTable.Chooseacolortheme.

Page 50: Microsoft Excel and Sanet.me

IfyouwanttoemailtheExcelfiletoacolleague,youcancopythetableandpasteinOutlookandyou’llhavethebeautifullookingtableinthebodyoftheemail.Yourcolleaguewillhavenoexcusetogiveregardingnotseeingoractingonthedata.

Sowhatifyouneededtoprintitforyourboss.

Page 51: Microsoft Excel and Sanet.me

Here’swhatyougetfromPrintPreview.

Page 52: Microsoft Excel and Sanet.me

SohowcanyoumakeExcelprintthistableonjustonpaper?

VeryEasy.

GotoPageLayoutmenu,andundertheScaletoFitsection,settheWidthandHeightto1page.

Page 53: Microsoft Excel and Sanet.me

Solet’sseetheresult.

Page 54: Microsoft Excel and Sanet.me

Goalachieved!Butitcouldhavelookedbetterifithadusedmorespace,thespacebelow.Soweneedtotryoutonemoresettingandseeifitwillgiveusabetterresult.WewillsettheOrientationtoLandscape.

Page 55: Microsoft Excel and Sanet.me

Let’sviewtheresult.

Page 56: Microsoft Excel and Sanet.me

Bravo!Thisismuchbetter!

WhatifthebosswantedjustJanuarytoMaydataandnottheentiretable?

Alsoveryeasy.

HighlightthetablefromthebeginninguptoMay,leavingoutJune.Sowearehighlightingjustwhatwewanttoprint.

UndersamePageLayout,ClickonPrintArea,andselectSetPrintArea.

Andthat’sit!Solet’sseetheresult.

Page 57: Microsoft Excel and Sanet.me

Therewehaveit,noJunedataincluded!

Onemorebigtip.

Whatifyouhaveabigtablethatwillprintontomanypagesbutyouwanttheheadertorepeatonthefirstrowofeverypage?

Belowisasample.

Page 58: Microsoft Excel and Sanet.me
Page 59: Microsoft Excel and Sanet.me

Noticethatthepagetwohasnoheadertohelpyouidentifywhatthefieldsare.

Sohere’showtofixthat.

StillatPageLayoutmenu,clickonthesmalliconatthebottomrightcorneroftheSheetOptionssection.

Page 60: Microsoft Excel and Sanet.me

Inthedialogboxthatcomesup,settheRowstorepeatattop

Page 61: Microsoft Excel and Sanet.me

SelectRow1thathastheheaders.

Page 62: Microsoft Excel and Sanet.me

Andthatisall!

Solet’sseetheresult.

Page 63: Microsoft Excel and Sanet.me
Page 64: Microsoft Excel and Sanet.me

Done.

Sothesearethebasicwaysyouformatyourdataforprinting.

Page 65: Microsoft Excel and Sanet.me

Charts

Excel2010has11maincharttypes.

Excel2013andExcel2016have10maincharttypes.Actually,9Ifyoutakecombochartasacombinationoftwoormoreothercharttypes.

Page 66: Microsoft Excel and Sanet.me

Butinallyouwillendupusingmajorly,

1. Columnchart2. Linechart3. Piechart,and4. Barchart.

Solet’sfocusonthesefourcharts.

ColumnChartandwhentouseit.Columnchartisusedtovisualizedataacrossdifferentcategories.Anexampleisrevenueacrossthefourdifferentbranchesofacompany.

Page 67: Microsoft Excel and Sanet.me

Sohowdoyouturnaboringdatalikethis:

Intoabeautifulinsightfulchartlikethis:

Page 68: Microsoft Excel and Sanet.me

Itisveryeasy.

SelectthetabledatayouwanttomakeachartofandgototheInsertmenu,clickontheColumnchartandselectthe2DClusteredColumnchart(thefirstoption).

Youwillgetachartthatlooksliketheonebelow.Notbadlooking,justneedsalittleformattingtomakegreat.

Page 69: Microsoft Excel and Sanet.me

Clickonthechart,andthecontextbasedmenuswillshowupontheExcelmenubar.

GototheFormatmenuandchooseaformattingyoulikefortheentirechart.Ifyourcompany’scorporatecolorisredandpurple,youmightwanttomakechartsthatreflectthatbrandcolor.

Page 70: Microsoft Excel and Sanet.me

Seetheresultredborderwhitefillformat.

Youcanalsochangethechartbackgroundcolor.

Page 71: Microsoft Excel and Sanet.me

Alsoyoucanchangethecolorofthebarsbyclickingonthemandchoosingthecoloryouwant.

Page 72: Microsoft Excel and Sanet.me

Andthisisthefinalresult.

Page 73: Microsoft Excel and Sanet.me

Itlooksbetterthanthedefaultandreflectsyourcompany’scorporatecolor.Justthatyoumightwanttonotusetheredborder.Mostprofessionalsarguethatit’sbesttonotuseanyborderorbackground,justmakeonlytheimportantthingsobvious–databarandtheaxislabel.Isuggestyoudowhateverlooksgreattoyou.Thisisnotanexamandmostlikelywhatwilllookgoodtoyouwilllookgoodtoyourcolleagueswhomyou’llsharethereportandchartswith.

Ifyoutryoutothercolorschemesyoucanendupwithchartslookingliketheonebelow.

Page 74: Microsoft Excel and Sanet.me

Theextrastepwetookbesidesremovingtheredborderandchangingthebarcolortobrightblueistochangethechartareabackgroundtowhite.

Page 75: Microsoft Excel and Sanet.me

Andthat’sbasicallyhowyouinsertandformatacolumnchart.Youcantryinsertinga3Dcharttooforthesamedata.Followthesamestepsbutchoosea3Dchartinsteadofthe2Dweearlierused.Andwhenyoudotheextraformattingalreadyexplainedtoyou,youcanendupwithabeautifulchartliketheonebelow.

Page 76: Microsoft Excel and Sanet.me

Finally,youcaninsertotherelementsonthechartlikethedatatable,asshownbelow.

Theresultisshownbelow.

Page 77: Microsoft Excel and Sanet.me

YouwouldhavenoticedthatthereareothercolumncharttypesbesidestheClusteredoneweselected(thefirstoption).

Asnumberedintheimageabove,theyare

1. ClusteredColumn2. StackedColumn3. 100%StackedColumn

Theclusteredcolumniswhatwehaveusedsofar.It’sstraightforwardtounderstand.Thestackedcolumnisusefulforshowingthebreakdownofthedatathatmakesupthebar.Belowisanexampleofitsuse.Wearegoingtobreakdowntherevenuebytheproducts

Page 78: Microsoft Excel and Sanet.me

thatcontributedtoit.

Todothisstackedcolumnchart,yousimplyselecttheentiretabledata,includingthebreakdownbyproductsandchoosetheStackedColumnchart.Andasyoucansee,itshowsabreakdownofeachbarbytheconstitutingparts(productsinthisexample)

Thethirdone,100%stackedcolumn,isjustslightlydifferent.Ratherthanshowyouthebreakdownbyproductrevenuevalues,itshowsthebreakdownbythepercentagecontributioneachproductmakestothetotal.Belowisthe100%StackedColumnoutputforthesamedata.

Page 79: Microsoft Excel and Sanet.me

LineChartandwhentouseit.

Linechartisusedtoshowtrend,usuallyoveratimeperiod.Anexampleisifyouwanttoshowthetrendofhowthecompany’srevenuehasbeengrowingforthelastfiveyears.

Page 80: Microsoft Excel and Sanet.me

Youcreatealinechartofatableinasimilarwayaswedidforthecolumnchart.Youselectthetable’sdataandgotoinsertmenu,clickontheLinecharttypeyouprefer.

Page 81: Microsoft Excel and Sanet.me

Again,Exceldoesafairlygoodjobandyoucaneasilyimprovetheformatofthechartusingthestepsalreadyexplained.

PieChartandwhentouseit.

Piechartisusedtoshowthecontributionofeachcategorytothepiethatrepresentsthegrandtotal.

BelowisanexampleshowingthebreakdownofNigerianpopulationbyregion.YoucanseehowthePieChartmakesiteasytoseethecontributionofeachregiontothetotalpopulationofNigeria.

Page 82: Microsoft Excel and Sanet.me

Itisextremelyeasytomake.You,likeforothers,selectthetable’sdataandselectPieChartundertheInsertmenu.

Exceldoesadefaultpiechartthatyoucangreatlyimprove.

Page 83: Microsoft Excel and Sanet.me

BarChartandwhentouseit.BarchartistechnicallythesameasColumnchart.Thedifferenceisthatwhenyouhaveatablewithlotsofentries,usuallyover8,youarebetteroffwithusingabarchartratherthanthecolumnchart.Alsowhentheentrieshavelonglabelnames,it’sbettertousebarcharteveniftheentriesaren’tmany.

Belowisanexample.

Page 84: Microsoft Excel and Sanet.me

ThesamerulesaboutStackedand100%stackedapplytobarchartand,even,linecharts.

ComboChart

Occasionally,youwillhavetocombinetwoormorecharttypesinonevisualization/graph.Thisisveryusefulifyouwanttoshowtwointerconnecteddataandtheircombinedrelevance.

Anexampleisshowinghowacompany’srevenuehasbeenchanginginvaluesandasagrowthratio.

InExcel2013andExcel2016,itisveryeasytomake.

Justselecttheentiretableandinsertacombochart.ItcanbeeasilylocatedunderRecommendedCharts.

Page 85: Microsoft Excel and Sanet.me
Page 86: Microsoft Excel and Sanet.me

PivotTableandPivotChart

PivotTableisExcel’spremiumtoolforworkingwithhugedatatableandevendatastoredinotherdatabasesystemslikeAccess,SQLserversandMySQLservers.

BelowisanexampleofalargedatatablewewillusePivotTableontodosomeveryrelevantquickanalysis.ItisatableofsalesforaparticularPizzaRestaurantforadayandithas5000entries.

SohowcanwemakeareportthatwillshowusthesalesperformancethatdaybythedifferenttypeofPizzastherestaurantsells.Areportliketheonebelow:

Page 87: Microsoft Excel and Sanet.me

It’squiteeasywithPivotTable.

Youstartbyselectingthesalestransactiontableorselectingoneofthecellsinit.ThengotoInsertmenuandclickonPivotTable.

Page 88: Microsoft Excel and Sanet.me

Inthescreenshotabove,Iselectedoneofthecellsinthetable,clickedonInsertmenu,clickedonPivotTable,confirmedthatmyentiretablehasbeenselectedandclickedonOK.

Youwillbetakentoanewsheetthatlooksliketheonebelow:

Page 89: Microsoft Excel and Sanet.me

Atfirstitlooksreallydifferent,likeyouarenolongerinExcel.Butitisveryeasytoworkwith.ThecorepartisthepartontherightwiththenamePivotTableFields.Ithasalistofallthefieldsintheoriginaldatatable.Thepartbelowthefieldnamesarewhereyouactuallysetupyourreport.

Whateverfieldyouwanttodisplayitsuniqueentries,oneperline/row,youwilldragtoROWS.Let’sdothatforthePizzaSoldfieldsowewillbeabletoseeallthepizzatypestherestaurantsells.

Page 90: Microsoft Excel and Sanet.me

Thenifitisthatyouwanttodisplaythoseuniqueentriesonepercolumn,dragthefieldtoCOLUMNS.Let’sseewhatwillhappenifwedragthatPizzaSoldfieldfromROWStoCOLUMNS.

`

Page 91: Microsoft Excel and Sanet.me

SonowyouunderstandhowROWSandCOLUMNSwork.

DragPizzaSoldbacktoROWS,thatiswhereweneeditforourquickanalysis.

NextisVALUES.Whateveryouwanttodoamathematicalcalculationon,youdragtotheVALUESpart.Commoncalculationsyouwillfindyourselfdoingarecounts(toseethenumberoftimeeachuniqueentryoccurredintheoriginaltable),sum(toaddthevaluesaparticularfield)andaverage(toaveragethevaluesofaparticularfield).

Inourcase,let’sdragQuantityandAmountSoldfieldstoVALUES.

Canyouseehowquickthisis?Wehavejustanalyzeda5000salesrecordtableinseconds.NowwehaveareportthatshowsushowmanyofeachPizzatypewassoldandthetotalsalesamountgenerated.

ThosearethetypeoflightningfastanalysisPivotTableallowsyoutodo.

Thereisnowonepartwehaven’ttouched:FILTERS.Asthenamesuggests,itsimply

Page 92: Microsoft Excel and Sanet.me

givesusthecapabilitytofilterourreport.WewilldragTimeRangetoFILTERStoseewhichsalesoccurredatthepeakperiod(before9:00am)andafterthepeakperiod.

Andthat’showPivotTableworks.Veryeasytouseandpowerful.

PivotChart

WheneveryouinsertachartusingdatageneratedviaaPivotTable,thatchartisaPivotChart.IthassomeextrafunctionalitiesitinheritsfromthePivotTablewhichmakesitalittledifferentfromtheregularchartswehavealreadydiscussed.

BelowisthePivotChartforthePivotTablewejustcreated.

Page 93: Microsoft Excel and Sanet.me

Noticetheextraelementsonit.EventheTimeRangefilterisshowingonthechart.Besidesthoseextraelements,aPivotChartissameastheregularchartsandthesamekindofformattingyoucandoontheregularchartsworkonPivotCharts.

Page 94: Microsoft Excel and Sanet.me

BusinessDataAnalysis

WhenusingExceltoorganizeoranalyzeyourbusinessoperationsdata,therearesometoolsyouneedtobeawareof.

LinkingSheetsYouoftenhavetopulldataintoareportfromanotherreportorExcelfile,themosteffectivewaytodothisistolinkthesheets.Youwillbemirroringthevalueinthesourcesheetinyourdestinationsheet.

AnexampleisifthereisasheetthatcontainstheinternalrevenueofallthestatesinNigeriaandyouaredoingareportonKebbistate.YouwanttopullthevaluesforKebbistatefromthesheetthathaseverything(sourcesheet),yourbestbetistolinkthesheets.Itispreferabletocopyingthevaluesfromthesourcesheetbecauseifthesourcesheetisupdatedwithnewvaluesyouranalysissheetwillnotautomaticallyupdate(willstillbeshowingthenowincorrectoldvalues).Sohowdoyoulinksheets?

Page 95: Microsoft Excel and Sanet.me

It’sveryeasy.Inthefieldsintheanalysissheet,forthedifferentmonthsvaluesyouwilltype=andselectthecellwiththeactualfigureinthesourcesheet.

Intheendyouwillhavethefollowingorsimilar:

Page 96: Microsoft Excel and Sanet.me

ThesourcesheethasthenameDatasheet,hencethe=Datasheet!B25inJanuaryvaluecellintheanalysissheet.Youdon’ttypeanythingbeyond=intothevaluescellsintheanalysissheet,onceyouselecttherightcellinthesourcesheet,Excelwillwriteeverythingyouseeinthecell.

DuplicatingSheets

Sometimesyouwillwantanexactcopyofasheettoworkwithoremailtosomeone(especiallyiftheExcelfilecontainsothersheetsyoudon’twantthepersontoaccess).Excelhasaniftytoolforduplicatingsheets.Andit’sveryeasytouse.

Rightclickonthenameofthesheetyouwanttoduplicate.ClickonMoveorCopy…

Page 97: Microsoft Excel and Sanet.me

You’llseeadialogbox.SelectnewbookandtickCreateaCopy.

AndthesheetwillbeduplicatedinanewExcelfileforyou.

Page 98: Microsoft Excel and Sanet.me

InsertingSheets,RenamingSheetsandChangingSheetTabcolor

YoucaninsertanewSheetinanExcelfile.Justclickonthenewsheeticonattherightofthelastsheettabinthefile.

Page 99: Microsoft Excel and Sanet.me

YoucanalsorenamethenewSheettowhatyouwant.JustrightclickonthesheettabandselectRename.

Page 100: Microsoft Excel and Sanet.me

Finally,youcangiveitthecoloryouwant.Again,rightclickonthesheetnameandclickonTabColor.Choosethecoloryouwant.

FreezingPanes

Page 101: Microsoft Excel and Sanet.me

Therewillbetimesyouhaveatabletowithlotsofentriesandwillrequirealotscrollingupanddown,andevenleftandright.Oftenyouwillwantsomepartofthetabletoneverscrolloutofview.Thisisusuallytheheaders.AchievingthisrequiresenablingatoolcalledFreezePanes.

Itfreezesthepartofyourreportyoudon’twanttoscrolloutofview.Belowisanexample.YouaccessitfromtheViewmenu.

Therearethreeoptions:

1.FreezePanes.Tousethisoptionyouhavetoselectacellinthetable.Thisoptionwillfreezealltherowsabovethecellyouselectedandallthecolumnstotheleftofthecellyouselected.Soyouhavetoselectjusttherightcell.Ifyouwanttofreezerows1and2,thenyouwillselectcellA3.

2.FreezeTopRow.ThisfreezesthetoprowinyourExcel’scurrentview.

3.FreezeFirstColumn.ThisfreezesthefirstcolumninyourExcel’scurrentview.

Belowistheresultoffreezingrow1.Itdoesn’tscrolloutofviewevenwhenIscrollwaydown.

Page 102: Microsoft Excel and Sanet.me

SplittingWindows

ExcelletsyousplityourcurrentExcelviewintotwoindependentwindowsthatyoucanscrollseparately.ThisisusefulifyouwanttomonitorchangesintwodifferentfarawaypartsofyourExcelfilethataredependent.

Anexampleisshownbelow.TheExcelfileisastockanalysisfileandatthetopfarrightareprojectedvaluesbasedonassumptionsmadefardowntheExcelsheet.Soinordertoseeinstantaneouslytheeffectofachangeinanassumptionontheprojectedvalues,splittingwindowwasused.

Andtheassumptionsfardown

Page 103: Microsoft Excel and Sanet.me

SplittingwindowallowsustoviewthistwofarawaypartsoftheExcelsheetatonce.

Todothis,selectthemiddlerowintheExcelsheetandgotoViewmenuandclickonSplit.

Thenscrollthesectionbelowthesplittingpointdowntotheassumptionspart.Itwillscrollindependentofthepartabovethesplitline.

Page 104: Microsoft Excel and Sanet.me

Noticethejumpfromrow10torow104.

Nowwheneveryoualtertheassumptionsyouwon’thavetoscrolluptoseetheeffectontheprojectedrevenueandprojectedprofit.

ConditionalFormatting

ConditionalformattingisanotherpowertoolinthepowerExceluser’stoolbox.Itallowsyoutoindicatetherelativeperformanceofmetrics(KPIs).Belowisasimpleexampleofitsuse.

Page 105: Microsoft Excel and Sanet.me

Noticethegreen,yellowandredarrows.Theyareconditionalformatsthatletyouvisuallyseewhereyouarespendingbelowyourbudget,whereyouarespendingexactlywhatyoubudgetedandwhereyouarespendingaboveyourbudget.

Thosearetypeofpracticalvisualanalysisconditionalformattingprovides.

YoucanaccessitviatheHomemenu.Andithasthefollowingformattinggroups.

Page 106: Microsoft Excel and Sanet.me
Page 107: Microsoft Excel and Sanet.me
Page 108: Microsoft Excel and Sanet.me
Page 109: Microsoft Excel and Sanet.me

PowerExcelFormulas

Excelhasthousandsofformulasbutaselectfewstandoutasveryversatileandusefulfordaytodaybusinessdataanalysisandreporting.Wearegoingtofocusonthoseformulasinthissection.

VLOOKUP

ThisisperhapsExcel’smostpopularfunction.IninterviewsitisusedtosievethepowerExcelusersfromtheoccasionalExceluser.Itspopularityliesinitseaseofuseandcapabilitytogetyouthedatayouneedfromanothertableifyouprovideitaclue.

Belowisanexampleofitsuse.

Theformulabreakdownis

Page 110: Microsoft Excel and Sanet.me

Lookup_value

=VLOOKUP(A2,A5:G24,2,FALSE)

Basically,itisaskingyoufortheclueyouhave.WhatpieceofinformationdoyouhavethatIshouldlookforinthetablethathaseverything.

Table_array

=VLOOKUP(A2,A5:G24,2,FALSE)

Whereisthetablethathaseverything?Sohereyouareselectingthetablethathaseverything.

Col_index_num

=VLOOKUP(A2,A5:G24,2,FALSE)

WhenIseetheclue,whatdatashouldIbringback?Thatdataisinwhatcolumncountingfromtheleftmostcolumnintheselectedtable.

Range_lookup

=VLOOKUP(A2,A5:G24,2,FALSE)

IfIamunabletofindtheclue,shouldItakeaguess?Usually,youwouldn’twantExceltotakeaguess,thatcouldcauseyoutrouble.SosaynobytypingFALSE.

AndthatishowVLOOKUPworks.Itwilllookthroughthefirstcolumninthetableyouselectedforthecluethatyouprovidedandwhenitfindsit,itwillbringbackthedatayouspecifiedforittoget.

Page 111: Microsoft Excel and Sanet.me

Itmakesalotofreportseasytodoandveryhelpfulwithmakingdashboards.

IF

IFisarguablythemostpowerfulfunctioninExcel.Itcandoalmosttheimpossible.Andit’sonlylimitedbythecreativityoftheuser.

Itallowsyoutocheckforaconditionandspecifywhatshouldbedonewhentheconditionismetandalsowhatshouldbedonewhenitisnotmet.

Hereisthestructure.

Page 112: Microsoft Excel and Sanet.me

Intheexampleabove,wehavespecifiedaconditionthatonlywhenthesalesmanmakesmorethan1millionnairaworthofsalesshouldhegetthesalesbonusof5%.Ifhefailstomeetthatconditionheisnotentitledtoanysalesbonus.

COUNTIFSandSUMIFS

Page 113: Microsoft Excel and Sanet.me

Thesecombineaninbuiltiffunctionwithsimplefunctionslikecountandsum.

ArelevantexampleisthePizzaSalesrecordweusedforPivotTable.WecouldhavegeneratedthesameanalysiswithoutPivotTablebyusingtheCOUNTIFSandSUMIFSfunctions.

FortheCountofSales,theCOUNTIFSstructureis

ThiswillcountcellsbetweenrangeB1andB5001wherethecellentryisequaltotheG3value(BBQChicken).Anditwasreplicatedfortheotherpizzatypes.

Page 114: Microsoft Excel and Sanet.me

FortheSumOfSalesAmount,theSUMIFSstructureis

ItwillsumvaluesincellsC1toC5001wherethecellsinB1toB5001hascellentryequaltoG3(BBQChicken).

AVERAGEIFSAVERAGEIFSissimilartoSUMIFS.Generally,IthinkitismuchlessusedthanSUMIFS.InmyseveralconsultingjobsforclientsIhaveusedmoreofCOUNTIFSandSUMIFSthanAVERAGEIFS.Itisparticularlyusefulinperformanceanalysis.Anexampleisifyouareastockanalystandyouwanttofindtheprofitmarginforaparticularindustry.YouwillneedtouseAVERAGEIFStospecifywhichcompaniestoincludeinthecomputationoftheprofitmargin,andstatistically,youcan’tcountorsumtheindividualprofitmargins,youhavetoaveragethem.

Belowisanexamplewe’lluseforillustration.

Page 115: Microsoft Excel and Sanet.me

SohowdowefindtheprofitmarginperformancefortheAirlineIndustry?WehavetouseAVERAGEIFS.

Hereishowitworks:=AVERAGEIFS(average_range,criteria_range,criteria)

TheaveragerangeinourcaseistheProfitMarginfield.Thatiswheretheprofitmarginvalueswewanttoaverageare.

ThecriteriarangeistheIndustryfield.Itiswherewewillidentifythecompaniesthatfallundertheairlineindustry.

ThecriterionwearelookingforisAirline.Butremembertoputitindoublequotes.Alltextsinaformulamustbeindoublequotes.

Theresultingformulawillbe:=AVERAGEIFS(C1:C22,B1:B22,“Airline”)

Page 116: Microsoft Excel and Sanet.me

IFERRORAlotoftimesyourformulasinExcelwillgenerateanerror.Itcouldbeforreasonsbeyondyourcontrol:amissingrecord,wrongvaluetypeoraproblematicentry.IFERRORletsyoutraperrorsanddisplaysomethingmoremeaningfulorlessannoyingthanthecrypticerrorentryExcelgivesyou.

Itssyntaxis:=IFERROR(value,value_if_error)

Anexampletoillustrateitsuseisgivenbelow.

NoticethatwehavenovalueforEnugustateanditisgeneratinganerrorinthe%agevaluefield.ItwouldbenicertohaveleftablankspaceorahypheninsteadofanerrorcodeintheEnugurow.

Page 117: Microsoft Excel and Sanet.me

IFERRORcanhelpuswiththat.Andhereishowwewoulddoit.

=IFERROR(B5/$B$9,”-“)whichissimplytellingExceltocalculateB5/$B$9andiftheresultisanerroritshouldputahypheninthecellinsteadofanerrorcode.

CONCATENATEConcatenateletsyoujoinentriesindifferentcells.

Thesyntaxis=CONCATENATE(text1,text2,…)

Aclearexampleiswhatwehavebelow.

Page 118: Microsoft Excel and Sanet.me

HowdowejointheFirstNameandLastNametogettheFullName?

ThisiswhatCONCATENATEdoesforus.

Page 119: Microsoft Excel and Sanet.me

Butthereisasmallproblem:nospacebetweenthefirstnameandthelastname.Howdowefixthis?

CONCATENATEcanhandlethat.Youarenotrestrictedtojoiningcellentries.Youcanputinyourowntextandthat’swhatwewilldotofixtheproblemwehave.

Wehaveaddedaspacebetweenthefirstnameandthelastname.Weaddeditasatextentry,hencethedoublequotesencapsulatingit.

=CONCATENATE(A2,”“,B2)

Page 120: Microsoft Excel and Sanet.me

Andthat’showyoucanjoindifferentcellentriesusingCONCATENATE.

I’msureyouarewonderingwhytheformulahadtobealongnameone.Well,thereisaveryshortalternativeoperator:&.

Wecansimplyjointhedifferentcellentriesbyputtinganampersand(&)betweentheentries.Soreplacingourlongformula,wewillhave:=A3&”“&B3

Page 121: Microsoft Excel and Sanet.me

Great,right?

Allthatisleftistodragtheformuladownfortheotherentries.

Page 122: Microsoft Excel and Sanet.me

LEFT,RIGHTandMIDTherewillbetimesyouneedtoextractaportionofacell’sentry.ApracticalcasewasatemplateIbuiltforatelecomscompanytodeterminetheleastcostpartnertouseforeachinternationalcalldestination.SoIhadtouseaformulatopickoutthecountrycodesandcheckwhichprovideristhecheapesttousetothatdestination.

Ihavepreparedasampledataforasimpleillustration.ItisthematriculationnumberoftheuniversityIattended.Itisaclevercombinationofdepartmentname,yearofadmissionandcandidatenumber.

Thefirstthreecharactersarethedepartmentacronym.Thetwodigitssandwichedbetweentwoforwardslashesaretheyearofadmissionandthelastfourcharactersarethecandidatenumber.

Page 123: Microsoft Excel and Sanet.me

WearegoingtouseLEFTtoextractthedepartmentname,RIGHTtoextractthecandidatenumberandMIDtoextracttheadmissionyear.

Itisaveryeasytounderstandformula:=LEFT(A5,3).Yousimplyspecifythecellyouwanttoextractfromandspecifythenumberofcharactersyouwanttoextractstartingfromtheleftmostcharacter.

Inthisexample,it’sthreecharacterswewanttoextractstartingfromtheleft(beginningofthecellentry).

Nowlet’sproceedtoextractingthecandidatenumber.Thistimewewanttoextract

Page 124: Microsoft Excel and Sanet.me

startingfromtheright,fourcharacters.SowewilluseRIGHT.

=RIGHT(A5,4)

Alsoveryeasytounderstand.

Finally,let’sextracttheadmissionyear.ItrequirestheMIDformula.It’salittlenoteasytograspliketheLEFTandRIGHT.Itrequiresthatyouspecifythestartingpointfortheextraction.Theconceptisveryeasytounderstand,thepartthattripsalotofpeopleupishowthestartingpointisdetermined.Youhavetocountfromthefirstcharacter(fromtheleft)tothefirstcharacteryouwanttoextract.

Page 125: Microsoft Excel and Sanet.me

Inthisexample,wewillcounttillthefirstcharacteroftheyear.Itisthecharacternumber5.Thenyou’llproceedtospecifythenumberofcharactersyouwanttoextract(2inourcase).

=MID(A5,5,2)

A5isthecellweareextractingfrom.

5isthestartingpoint.

2isthenumberofcharacterswewanttoextract.

Page 126: Microsoft Excel and Sanet.me

TODAY,DAY,MONTHandYEARExcelallowsyoutodoalotondates.Thereisevenaformulatocalluptoday’sdate;itisaptlynamedTODAY().Youhavetoenterthebrackets.

Thenyoucanextractthedayofthedate,themonthofthedateandtheyearofthedateveryeasily.

Page 127: Microsoft Excel and Sanet.me
Page 128: Microsoft Excel and Sanet.me

=DAY(A3)

=MONTH(A3)

=YEAR(A3)

A3isthecellthathasthedate.AnditworksondatesyoumanuallytypeorcopyintoExcelandnotjusttheonesweuseaformulalikeTODAY()togenerate.

Finally,Excelletsyouchoosehowadateshouldbedisplayed.RightclickonthecellhousingthedateandclickonFormatCells.

Page 129: Microsoft Excel and Sanet.me
Page 130: Microsoft Excel and Sanet.me

Youcanspecifyhowitshouldbedisplayed.

UPPER,LOWERandPROPEREvertriedchangingatextfromuppercasetolowercaseinExcel?Tooquicklypeoplegiveupandconcludethatit’snotpossibleinExcel.Well,Excelhasthatfunctionalitybutasaformula.

UPPERconvertsacellentrytoalluppercase.

LOWERconvertsacellentrytoalllowercase.

Propercapitalizesthefirstletterofeachwordinthecell.

Page 131: Microsoft Excel and Sanet.me

A1isthecellentrywewanttochangethecapsof.

SeetheresultsoftheUPPER,LOWERandPROPERformulasbelow.

RANDandRANDBETWEENWonderedhowIgeneratedallthedataIhavebeenusingforillustrations?Well,IusedRANDandRANDBETWEENformostofthenumbersandevensomeofthetexts(inconjunctionwithamagicformulacalledINDIRECT).

RAND()generatesrandomdecimalnumbersthataregreaterthan0butlessthan1.Essentially,decimalnumbersbetween0and1(0and1non-included).

RANDBETWEEN(bottom_number,top_number)generatesnumbersbetweenthebounds

Page 132: Microsoft Excel and Sanet.me

youspecifiedasbottomandtop.

Belowisarelevantexample.Ihaveusedtheformulastogeneratesalesnumberandprofitmargin.

Page 133: Microsoft Excel and Sanet.me

NamedRange,GoalSeekandScenarioManager

Excelhassomewhat-if-analysistoolsthatgreatlyhelpwithbusinessdecisionanalysis.Youcaneasilysimulateeffectofchangesincircumstancesonyourbusinessprojectionsandcreatecompellingbusinesscaseanalysis.

NamedRangeExcelletsyounameacelloraselectionofcells.It’sveryusefulwhenyouarebuildingmodelsinExcelasitmakesthemodelformulaseasytowriteandtroubleshoot.

TheyaretwowaystocreateanamedrangeandIwillstartwiththeveryquickandeasyway.

Justselectthecellorgroupofcellsyouwanttoname.Gotothenameboxandtypeinthename,replacingthecelladdressinthenamebox.

We’vesuccessfullynamedalltheImostaterevenuevaluesasImo.Asbenefitnumber1,wecanuseitinaSUMformulainsteadofhighlightingtheentirerange.

Page 134: Microsoft Excel and Sanet.me

AnotheradvantagewillbecomeobviouslaterwhenwedoScenarioManager.

Sowhatisthesecondwayofcreatinganamedrange?

Itis,infact,thestandardway.It’salsotheonlywaythatallowsyoutoeditanalreadycreatednamedrange.

GotoFormulasmenuandclickontheNameManager.

Youcancreatenewnamedrange,editalreadycreatedonesanddeleteanamedrange.

Page 135: Microsoft Excel and Sanet.me

GOALSEEKGoalseekisoneofthosepowerfulbutseldomusedtoolsinExcel.

Itallowsyoutoset-upasmallmodelandtellExceltooptimizeitforyoubasedononevariableinputandonesetoutput.It’stheperfectintroductiontoamodelandlinearprogramminginExcel.

Let’sasimpleandcommonusecase.Belowisaloancalculationtable.Let’ssayIhavefoundahugebusinessopportunityinlargescalecocoafarmingandIwanttoborrowN100millionfromthebank.Andthetablebelowistheconditionsthebankgaveme:apaymentperiodof10yearsandannualinterestrateof24%.

Excelhasaformulaforcalculatingtheannualpaymentamount.

Page 136: Microsoft Excel and Sanet.me

SoIgoandcheckmybusinessfinancialprojection,andfindoutthatIcanonlyaffordtomakeN20millionannualpayment.WhatratewillInegotiatewiththebank?

ThisiswhereGoalSeekcomesin.WesimplytellittofindoutwhatinterestratewillevaluatetoN20millionannualpayment.

ToaccessGoalSeek,gotoDatamenuandWhat-If-Analysis.

Page 137: Microsoft Excel and Sanet.me

IsetpaymentamountcelltoN20millionandtellGoalSeektovarytheinterestrate.

OnceIclickonOK,itdoesaseriesofiterationandgivesmetheresult.

Ishouldaskfor15%annualinterestrate.

Page 138: Microsoft Excel and Sanet.me

ScenarioManagerScenarioManagerisoneofExcel’sdecisionanalysistool.Itallowsyoucompareoutcomefordifferentbusinessscenarios.

Belowisapracticalbusinessusecaseofthescenariomanager.Itistakenfromourbusinesscircumstanceandyou’llfinditveryinteresting.

WerunaMicrosoftExcelandBusinessDataAnalysisbusiness.Ourmajorincomestreamsareconsultingforbigmultinationalfirmsondataanalysisandbusinessprocessautomations,andMicrosoftExceltraining.Solet’ssaywedecidetorunaspecialonedayMicrosoftExceltraining.Itwasspecificallymyidea.IhadstumbledonatrainingadvertonPunchnewspaper.AonedaytrainingatVCPHotelandcostingN80,000.SoIfeltweshouldtryittoo.ButIneededtobuildaconvincingbusinesscasefortheidea.AndindoingthisIusedscenariomanager.

Icalledupthehoteltogetthedetailsofthecostofhostingafulldaytrainingintheirconferencehall.Ithenwenttoworkontheothercoststhatwouldbeincurredinputtingtogetherthetraining.Andbelowisthesheetofthecostdetails.

Page 139: Microsoft Excel and Sanet.me

Andtheunderlyingformulasare:

Page 140: Microsoft Excel and Sanet.me

Asyoucansee,Ihavegotteneverycostitemlisted;theestimatednumberofparticipantsandthecoursefeetoo.ButtobuildaconvincingbusinesscaseIneedtocreatedifferentscenarios.Maybethreescenarios.

Scenario1:Theworstthatcouldhappenifwedon’tmarketthetrainingwellandputthecoursefeeenticinglylow.Scenario2:Themostlikelythingtohappenifwedoourregularmarketingandput

upafaircoursefee.Scenario3:Whatwouldhappenifeverythinggoesextremelywell.Whichwillbe

ourmarketingaim.

SohowdoyousetupthisscenariosinExcel?YouuseScenarioManager.

ButfirstweneedtouseNamedRangeforthemostimportantcellsinourscenario.TheyaretheGrossProfitcell,theNumberofParticipantscellandtheCourseFeecell.InourscenarioswewanttomonitorwhattheGrossProfitwillbefordifferentcombinationsofNumberofParticipantsandCourseFee.

Page 141: Microsoft Excel and Sanet.me

IhopeyourememberhowtodoNamedRange.Yousimplyselectthecellorrange,gotothenameboxandtypeinthenameyouwanttonametheselectionas.

WedosameforCourseFee.

Page 142: Microsoft Excel and Sanet.me

AndforGrossProfit.

Page 143: Microsoft Excel and Sanet.me

Now,welaunchtheScenarioManager.

ItisunderDataMenu,What-If-Analysis.

Page 144: Microsoft Excel and Sanet.me

Solet’saddthethreedifferentscenarios.

I’llstartwiththeworst.ClickonAddandgivetheScenarionameasWorst.ThecellswewillvaryaretheNumberofParticipantsandCourseFeecells.

Page 145: Microsoft Excel and Sanet.me

ClickonOK.

Itwillaskyoutosetthenumberofparticipantsandcoursefee.Sobasedonexperience,IknowthatifwedonoseriousmarketingandsetthepricetoN45,000wecanget20people.Andthatistheworstthatcanhappen.

ClickonOK.

Page 146: Microsoft Excel and Sanet.me

Createasecondscenario.Nameit“Probable”.Itwillbewhatwewillmostlikelyachieve.Givethenumberofparticipantsas30andthecostasN70,000.

Finally,dothelastscenario.Nameit“Ideal”.Itwillbeourmarketingaimifwedecidetogoaheadwiththetrainingidea.Givethenumberofparticipantsas40andthecostasN100,000

Onceyouaredone,theScenarioManagerdialogboxwouldlookliketheonebelow.

ClickonSummary.ItwillaskyoufortheResultcelltomonitor.ThatistheGrossProfitcell.

Page 147: Microsoft Excel and Sanet.me

ClickonOK.

Youwillbetakentoanewsheetshowingthecomparisonofthedifferentscenarios.

Andasyoucansee,Inowhaveaconvincingcasetoshowmypartnersandmakethemagreetoorganizingtheonedaytraining.

That’showeasyandpowerfultheScenarioManageris.

Page 148: Microsoft Excel and Sanet.me

IntroductionToExcelVBA(macros)

AlotofpeoplefeelmakingmacrosinExcelisextremelyhardandshouldbeleftonlypeoplewhomakealivingfromdoingitfull-time.Ifyouareoneofsuchpeople,Ihaveapleasantsurpriseforyou.MacrosinExcelareveryeasyandinthenextfiveminutesIwillguideyouintomakingone.

Sojustbeforewestart,letmedoabriefexplanationofwhatamacrois,whyyoumightneedtomakeoneandthebenefitsofbeingabletomakeone.

MacrosaresimplyameansofautomatingtasksinExcel.It’snomorethanthat.Youmightneedtodoitwhenyouhaveadailyorweeklyreportyoumakethatisofanunvaryingstandardformat,inputandoutput-wise.Havingamacrocancutyouranalysistimefromhoursto15seconds.It’slikemagicandeveryoneinyourofficewillseeyouasaspecialbeing.

Tobeabletomakemacros,youneedtomakeasmallsettingschangeinyourMicrosoftExcel.

GotoFiles,OptionsandCustomizeRibbon.ChecktheboxbesideDeveloper.

Page 149: Microsoft Excel and Sanet.me

NowyouwillbeabletoaccesstheDevelopermenu.

Page 150: Microsoft Excel and Sanet.me

AlsoenablingtheMacrorecordbuttonwhichwewilluseinthisintroductiontoExcelVBA.

Page 151: Microsoft Excel and Sanet.me

Next,Iwillshowyouhowtocreateamacrobyclickingtherightbuttontwice—themacrorecordbutton.

Ihavepreparedasampleillustrationdata.

ItisfictitioustableofSalesatanAutodealershipbythedifferentsalesmenandthecarmake.

SothetaskIwilluseamacrotoautomateisaseriesofformattingsteps.

Note:Forthegurus,itwouldbeobviousthatcopypastingformatwouldhavedonethesamethingourmacrowilldo.Yes.Butwehavetodotheillustrationwithsomethingnottoocomplextoconfuseanyone.Thegoodthingisthatyouwilllearnallthestepsrequiredtomakeanycomplexrecordedmacroyoudesire.

Soherearetheeasystepstocreatingamacro.

Page 152: Microsoft Excel and Sanet.me

First,IselectthemonthIwanttomanuallydotheformattingforandhavethemacrorecordersavemysteps.

Clickonthemacrorecordbutton.

Page 153: Microsoft Excel and Sanet.me

Givethemacroaname,akeyboardshortcutandadescription.

Page 154: Microsoft Excel and Sanet.me

ClickonOK.

Thenbegindoingtheformattingsteps.Ichangethefonttype,fontcolorandaddborder,makingithaveourcorporatecolorfeel.OnceIamdone,Iclickonthestoprecordingbutton.

Page 155: Microsoft Excel and Sanet.me

Andthat’sall.Wehavecreatedamacro.Nextistotryitoutandseeitwork.

Selectanothermonth’srecordandpressCTRL+k(thekeyboardshortcutweusedforthemacro).

Page 156: Microsoft Excel and Sanet.me
Page 157: Microsoft Excel and Sanet.me

Voila!Itworks!

Solet’sinsertamacrobutton.Abuttonyouwillclicktorunthemacro.Iamsureyou’veseenonebefore.Theyaresupereasytocreate.

GototheDevelopermenu,InsertandselectButtonunderFormControls.

Page 158: Microsoft Excel and Sanet.me

Drawarectangularbuttonwhereyouwantthemacrobuttontobe.Immediately,Excelwillaskyoutoselectthemacrotolinkitto.Selectthemacrowejustcreated.

ClickonOK.

Theneditthenameoftherectangularbutton.

Page 159: Microsoft Excel and Sanet.me

Andthat’sit!You’vecreatedamacrobutton.

Nowselectanothermonth’sdataandclickonthemacrobuttontoseeitworkthemagicweconfigureditfor.

Page 160: Microsoft Excel and Sanet.me

Seetheresult!

Amazing,isn’tit?

IhopeyouarenowconvincedthatcreatingamacroinExcelisveryeasy.

It’snowtimeforyoutothinkupothercreativewaystousearecordedmacro.

Bonnechance!