Você está na página 1de 15

M MicrosoftEx xcelPart P 4:

Piv votTabl les

CenterforTeaching g&Learning g

P PivotTable es o OpenExcel2010 InsertaPiv votTable o Crea atingthePi ivot Table E Examplefo orClass A AddaRepo ortFilter o InsertSlicer F FiltertheDate D G GrouptheDates C ChangingtheViewof fthe R Report C ChangingtheFormat tofthe P PivotTable e F FiltertheSalesperson S nData F FilterbyLa abelFilters o Hidd denData C ChangeHo owSubtota alsare V Viewed mple:View wing o Exam thetotals t as SUM M/COUNT o ReNaming N Header C Creating&Formattin nga P PivotTable eChart o FilterwithinaPivot TableChart F Formatting gaPivotTa able C Chart

Table T ofCo ontents .. ..... .. .. .. .. .. .. .. ... .. ... ... ... .. ..

2 2 4 5 5 6 7 8 8 9 10 0 10 0 11 1 11 1 11 1 12 2

.. .. .. ..

12 2 13 3 13 3 14 4

Pivo otTables s
Yourworksheethaslotsofdata,butdoyou uknowwhatthe t numbers mean?Doesyourdataan nswerallyour rquestions? Pivot tTablereportscanhelptoanalyzenumericaldataan ndanswerqu uestionsabou utit. Insecondsyoucanseewhoso oldthemost,andwhere.See S whichqua arterswereth hemostprofi itable,andwhichproduct soldbest.Askque estions,seeth heanswers. WithPivotTablere eports,youcanlookatthe esameinform mationindiff ferentwaysw withjustafew wmouseclick ks.Data swing gsintoplace, ,answeringquestions,tellingyouwhat tthedatame ans. Imag gineanExcelworksheet w of fsalesfigureswithhundredsorthousan ndsofrowso ofdata.Thew worksheetlay ysoutallthe dataaboutsalesp peopleintwocountriesandhowmuchtheysoldon individualdays.Butit'sal lotofdatatodealwith listed dinrowafter rrowanddivi idedintomultiplecolumns s.Howcanyo ougetinform mationoutoftheworkshee et?Howcan youm makesenseout o ofallofth hisdata? Whosoldthemos stoverall?Whosoldthemost m perquar rterorperyea ar?Whichco ountryhasthe emostsales?Youcanget answ werstoallthe esequestionswithPivotTablereportsit'sliketurn ningamobintoamarching gband.APivotTable reportturnsallthatdataintosmall, s concise ereportsthat ttellyouexac ctlywhatyou uneedtoknow.

Ope enExcel20 010


Goto othewindow wsiconinthebottomleftcorner, c select tprograms,M MicrosoftOffic ce,andExcel2010.

BeforeyoustarttoworkwithaPivotTablereport, r takealookatyour rExcelworksh heettomake esureitiswellprepared forth hereport.When W youcrea ateaPivotTab blereport,eachcolumnof fyoursourcedatabecome esafieldthat tyoucanuse inthe ereport.Field dssummarize emultiplerow wsofinforma ationfromthe esourcedata a.Thenames softhefields sforthe reportcomefrom mthecolumntitlesinyoursourcedata. Nowthatyouhav veopenedExc cel2010goto otheFiletab, ,scrolldown toOpenand dselectyourd datayouwou uldliketo work kin.Forclass spleaseopenthedatathatwasemailed dtoclasspar rticipants.

Thed datathatyouopenforclas ssshouldlooklikethepict turebelow:

1 1. Besureth hatyouhaveanameforeachcolumnacross a thefirs strowoftheworksheetin nthesourced data.Inthe pictureab bove,thecolu umntitlesCountry,Salesperson,Order Amount,Ord derDate,and dOrderIDwillbecomefield d names. Whenyou ucreatearep port,you'llkn now,forexam mple,thatthe Salespersonfieldreprese entstheSales spersondata fromtheworksheet. w 2 2. Therema ainingrowssh houldcontain nsimilaritem msinthesam mecolumn.Fo orexample,te extshouldbe einone column,numbers n inan nothercolumn,anddatesinanotherco olumn. w acolum mnthatconta ainsnumbers sshouldnotc containtext,a andsoon. Inotherwords, 3 3. Finally,th hereshouldbe enoemptycolumns c withinthedatath hatyouareus singfortheP PivotTablerep port. Wealsorecommendth hattherebenoemptyrow ws;forexamp ple,blankrow wsthatareus sedtosepara ateoneblock ofdatafro omanothershould s berem moved.

Inse ertaPivo otTable


Whenthedataisready,placethe t cursoran nywhereinthedata.Then, ,ontheInser rttab,intheT Tablesgroup,click tTable,andth henclickPivo otTableagain.TheCreatePivotTabledi alogboxope ens. Pivot

Sele stherangeo ectatableorrangeisalre eadyselected dforyou.TheTable/Rang geboxshows oftheselected ddata. New wWorksheetisalsoselecte edforyouastheplacewh heretherepo ortwillbeplac ced(youcanclickExistingWorksheetif f youd don'twantth hereportplac cedinanewworksheet). w Click C OK. Whenyoufirstcre rstisthePivo eateyourpivottableyoushould s seetw wodifferentt ables.Thefir otTable.The ePivotTable willa appearonthe eleftsideofyour y screen.Thesecondis sthePivotTa ableFieldList tthiswillapp pearontherig ghtsideof yourscreen.

No oticethatPivo otTableTools sappearonth heRibbon,in ncludingtheO OptionsandD Designtabs.

Crea atingthePivot P Table


Pivot ttablesareus sedtocompileallofyourdatatogetherwhilealsop providingnum merouswaystofilterands sortthedata. . reateaPivotT Tablesimplycheck c thebox xnexttothefield f name,o orrightclickafieldnamea andselectalo ocationto Tocr move ethefieldto(i.e.AddtoReport R Filter,Add A toRowLables, L Addto oColumnLab bels,andAddtoValues). Youa alsohavetheoptionofclic ckingonanyofthefieldna ames,holding gdownthem mouseanddraggingtheite emtooneof thefieldsbelowwithin w thePivotTableField dList.

mostimporta antthingtore ememberabo outPivotTablesisthatitis saprogramt tohelpyoupr roducethere elevantdata Them witho outhavingto ogothroughand a manually yselecteachentry. e Alsobeawaretha ateverychang geyoumakecaneasilybe eremovedify youlaterdeci idethatitisn nothelpful. Tip:Ifyouclickou utsideofthelayoutarea(ofaPivotTab blereport),th hePivotTableFieldListgoe esaway.Togetthefield listback,clickinsidethePivotT Tablelayoutarea a orreport t.

Exa amplefor rClass


Using gthePivotTa ablewejustentered e wear regoingtoad ddacoupleof fthefieldnam mesintorow wsandcolumn nssothatwe canb begintowork kwiththedat ta.Tostartad ddthefieldnames n of1)Sa alesperson,a and2)SalesA Amount. Thed dataintheSa alespersonfie eldisautomat ticallydisplay yedasrowso ontheleftside eofthereport.ThedataintheSales Amountfield,whi ichdoescont tainnumbers, ,correctlysho owsupinan areatotheright.Rightaw waythisisgo oingtoshow aleandforho owmuch. uswhomadeasa

WhenwegettoReport R Filterbelow, b weare egoingtoadd d3)Countryt toourPivott table.

Add daRepor rtFilter


Youm mayusearep portfiltertofocus f onasub bsetofdatainthereport, oftenaprod ductline,atim mespan,orageographic regio on.Tofollowalongwithth heclassexam mpleaddCoun ntrytothere eportfilter. Toad ddafieldasareportfilter, , 1 1. Rightclick kthefieldnameinthePivotTableFieldList,and 2 2. Thenclick kAddtoRepo ortFilterOR 3 3. Clickanddragthefield dnameintotheReportFilteratthebot ttomoftheP PivotTableFie eldList. TheR Reportfilterwill w thenappe earatthetop pofthescreenontheleft handside.Areportfilterwillnotprod duceanydata rightaway,insteaditprovidesadownwardarrowthatallowsyouto selecttheinf formationyou uwouldliket tosee.

Chec cktheboxnex xttoSelectMultiple M Item ms.Thiswillallow a youto selectwhichcountryyouw wouldliketofilterthe datathrough. Tip:ToremoveafieldfromaReport R Filter,uncheckthe echeckboxbe ePivotTableFieldList. esidethefieldnameinthe Tore emoveallthefieldsfromthereportsothat t youcanstartover,on ntheRibbon, ,ontheOptio onstab,inthe eActions group,clickthear rrowontheClear C button,andthensele ectClearAll. Forthenextpartoftheinclassexamplewe earegoingto oaddOrderD Datetothepi ivottablebyc clickingonth hefieldname.

Inse ertSlicer
Aslic ceristhesam methingasaddingaReportFilteraswe w didabove, ,howeverthe eslicerisamoreinteractiv vewaytosee e thec changesbeing gmadetothe echart.Forpurposes p offo ollowingthec classexample ewearegoingtoaddtheCountryasa slicer r. Todo othisgototh heOptionsta abandselectInsertSlicer.Thenclicko nInsertSlice er.Alistwillt thenappearw withallofthe e fields syouhaveon nthePivotTa ableFieldList. .Selecttheit temyouwou uldliketocrea ateintoaslic cerandclickO OK.Forclass purposesaddCou untry.

Youw willthenseethatbothCan nadaandtheUnitedState esareputona littlecharta atthetopofthescreenfo oryou,thatis thes slicer.Tosele ectonecountryjustclickon o itandyouwill w seethed databeingfilteredtothele eft. Tose electmorethanoneitemhold h downtheCTRLkeyan ndclickthec ountriesyouwouldliketo oadd. Justl likemostarea asinMicroso oftOfficether reareoptions stoformatth hisfunctionto oappeardiffe erently.Whe enyouinsert aslic certheSlicerTools T tabwillappeargivin ngyouafewoptions o tofor rmattheslice er.

Youc canresizetheslicerbyclickinganddra aggingonthe ecornersofth hebox.Tofo ormatthecolo oroftheslice ergotothe Optio onstab,intheSlicerStyles sandclickon ntheMorebu utton.There youwillseea alloftheopti ionsforformattingthe slicer r. Oneotherthingis sthatyoucan nchangethenumberofco olumnswhich hcanmakeso omeslicersea asiertoread.

FilterbyDat te
Using gdifferentfilt ters,youhavetheabilityto t filterthere eporttoseed dataforcerta aindates.Clickonacellwithdateinit. Right tclickandpo ointtoFilter,and a thensele ectDateFilters. TheD DateFilter(O OrderDate)dialogboxwillappear.Fortheinclasse exampleselec ctisbetwee enandenter rthedates 1/1/2 2009&1/30/ /2009andclic ckok.

Ther reportshowsdatanowlim mitedbythedate d restrictio onsset.Tocl earthedatefilter,rightcl lickonadate edcell,point toFil lterandclickonClearFilte erfromOrde erDate. Tip:Youcanalsoclearthefilte ersbyplacing gthecursorover o thefilter icon next ttotheOrder rdatefieldinthe Pivot tTableFieldList.Clickthearrow a thatap ppears,andth henclickClea arFilterFrom"Orderdate" ".

Gro ouptheDates D
Whentherearela argeamounts sofdatagroupingtheda atestogether rcanbeanef ffectivewayt togetthedat taintoa mana ageableform. Togr roupthedate es, 1 1. Clickadat teintherepo ort. 2 2. OntheOp ptionstab,intheGroupgr roup,clickGr roupField. 3 3. IntheGro oupingdialog box,selectQuarters Q ,whichseemslike eagoodsolut tionforthein nclassexamp ple,andthen clickOK.

Note e:Whenyouaregroupingitemsyouca angroupbymore m thanjust tonething(e e.g.selectingbothmonths sand quart ters). rthedatahas sbeengroup pedyouwillnoticethatth hesalesdata isgroupedin ntofourquar rtersforeachsalesperson. After

Tip:Thereisstillalongchartto t scrollthrou ughyoucanmove m thefield dnamestoge etadifferentview.Todot that,move theO OrderDatefie eldfromtheRowLabelsareatothecolumnareaof thereport(c calledColumn nLabels). Youc candothisby ydragginganddroppingth hefieldname eorgotoada ateonthepiv vottableandrightclickon neofthe dates s.Next,selec ctMove,andthenchooseMoveOrde erDatetoCo olumns.Youshouldseealloftheinfor rmationinthe e main nscreenwitho outhavingtoscrollthroug ghoutexcelto oseeallofth edata. purposesoffo ollowingalongwiththeinclassexamplemovetheO OrderDateba acktotheRo owsLabel. Forp

angingtheViewoftheRep port Cha


AswithinallMicro osoftOffice2010 2 program mstherearenumerous n way ystodothee exactsameth hing.Belowy youwillsee three edifferentwa aystomovedifferent d field dsaroundtochange c thelo ookofyourpivottabledata. 1 1. DropandDragmethod d:GotothePivot P TableFi ieldListonth herightsideo ofthescreen,clickonthef fieldname dliketomove e.Holddown nthemouseand a dragthe fieldnamein ntothedesire edfieldbelow w(i.e.Report youwould Filter,ColumLables,Ro owLables,or rValues). 2 2. RightClick kandmove:Gotothelef ftsideofthescreen s andcl ickinthebox xofafieldyouwouldliket tomove. Rightclick kandselectMove, M andthe enchooseMo oveOrderD DatetoColumns. deofthescre 3 3. RightClick kwithinthePivot P TableFie eldList:Goto t therightsid eeninthePiv votTableField dList.Select thefieldname n youwouldliketomo ove,rightclic ckandselectR ReportFilter, ,ColumnLabl les,RowLables,orValues.

Cha angingtheFormat tofthePivot P Tabl le


Youc canquicklych hangethefor rmatofarepo ort.You'lldothatinthisex xercise. Clickanywhereinthereport.At A thetopofthe t window,on o theRibbo n,clicktheDesigntabund derPivotTableTools.In theP PivotTableSty ylesgroup,cli icktheMorebutton sothatyoucan nseeallthest tyles.Asyoumovethepo ointerovera style,eachstyleis sshowninatemporary t previewinthereport.Scrollldowntosee ealltheavaila ablestyles.Ifyouseeone youlike,clickitan nditwillbeappliedtoyou urpivottable. .

Note e:ClicktheBa andedRowscheck c boxandtheBanded dColumnsche eckboxtotry ytheoptions.Clearthech heckboxes after ryouselectth hemtogowit thoutbanded drowsorcolu umns. Youc canalsoturnrowheadersandcolumnheadersform mattingoffan ndonbyclicki ingtheRowH Headerschec ckboxand tableor theC ColumnHeaderscheckbox xinthePivotT TableStyleOptionsgroup .Toinsertbl lankrowsint toyourpivott changethelayout tsimplyclickthedropdow wnarrowinth heLayoutg groupandsel lecthowyouwantthepivottableto appe ear.UndertheDesigntabchangesarebeingmadeto t theappear ranceofthep pivottablean nditwillnota alterthedata a inanyway.

FiltertheSa alespersonData
There earealsosom mefiltersthatareautomaticallyputint tothepivotta ableforexam mpleyoushou uldseeadow wnwardarrow w abov vethesalespe ersoncolumn.Clickonthe edownwardarrow a andyo ouwillseealloftheSalesp personandyo ouhavethe optio onofselecting gallorjustafewofthesa alespeople.

Once eyouhaveselectedallorjustafewofthe t namesyo ouwillseethe edownwarda arrowchange etoafiltersy ymbol.Thisis s lettin ngtheviewer rknowthatth hecolumnhasbeenfiltere ed.

10

FilterbyLab belFilters s
Here ewehavetheoptionofpullingoutaspecificsalespe ersonbytheir rnameutilizin ngalabelfilte er.Todothis ssimplyright person(inclassexample),selectFilter, andselectLa abelFilters.Adialogboxw willappeal clickonthenameofthesalesp titled dLabelFilter(Salesperson n).Totheleft tyouwillseethedropdow wnarrow,sele ectEquals.N Nexttypeinth he sales spersonsnam meyouaresee ekingtopullout o andclickOK. O

Tore emovethefilt ter,justrightclickonthename, n andselectClearFilt terfromSalesperson. Tip:Anotherwa aytoclearthe efilterisinth hePivotTableFieldList.Yo umovethec cursoroverth hefiltericon RowLabels,clickthe t arrowtha atappears,an ndthenclickClearFilterFr rom"Salespe erson." nextto

Hidd denData
Youd dohavetheoption o withinthepivottab bletohidesomeoftheinfo ormationwit thoutactually yremovingitfromthe table e. Forp purposesofutilizingtheinclassexamplerightclickon o Buchanan .Next,selectFilterandse electHideSe electedItems. mecategory, Youw willnoticeBu uchananisnolongeronthetable.Tore etrievetheda atabackjustrightclickagaininanynam point ttoFilterand dclickonClea arFilterfrom mSalesperson n.

Cha angeHow wSubtota alsareVie ewed


Excel l2010hasnu umerousways stoaltertheappearanceof o thepivotta able.Anothe erwayisbych hanginghowthesubtotals s appe ear.TodothisgototheDesigntaband dselecttheSu ubtotalsicon n.Therewillb beadropdow wnmenuwit ththree optio ons.Selectallthreeoption nstoobserve ehowitforma atsthesubto talsonthepi ivottable.

11

Exam mple:View wingtheto otalsasaSUMandas saCOUNT T


Uset thesamefield dtwiceinthe ePivotTablereport, r andch hangehowth hefieldissum mmarized.Yo oucandisplay ythesame fieldmorethanon nceinthePiv votTablerepo ortasasepara atecolumnin ntheValuesa area.Thisish handywheny youwantto yzethesamedatainmore ethanonewa ay. analy Inthisexerciseyo ouwilladdthe eSalesAmou untfieldtothereportasec condtime,an ndthenchang gehowthefieldis summ marized.Then nyou'llbeab bletoseeboth hthesumofthesalesamo ountandhow wmanyindivi idualsalesea achperson made e,sidebyside e. Toad ddthefieldto otheValuesarea a asecond dtime,rightclick c theSales sAmountfield,andclickA AddtoValuesorsimply clickanddragtheSalesAmoun nttotheValu uesarea. Forthecolumnwejustadded,clickanywhe ereinit,andgo g uptotheO Optionstaba andclickSum mmarizeValue esByandthis s timeclickCount.NowwehavetheSUMof fallthesalesontheleftan ndthenumbe erofsaleson ntheright.

Note e:Youmayalsorightclickanywhereinthatsecondcolumn, c selec ctSummarize eValuesBya andclickonC Count.

NamingHe eader ReN


Nowthetitleabov vethecolumnsays"CountofSalesAm mount2,"beca ausetheCOUNTfunctionh hassummariz zedthedata, inste eadoftheSUM Mfunction.It tstillsays"2"becauseitis sthesecondi nstanceofth heSalesAmou untfieldinth hereport. Atth hetopofthewindow, w ontheRibbon,clicktheOptio onstabunder rPivotTableT Tools. Inthe eActiveField dgroup,lookforthetextbox b withtheheading, h Cou ntofSalesAm mount2.Ifyo oudon'tseethe"Count..." titlei inthebox,cli ickintheValu uesareainco olumnCtomakeitappear r. Clickintheboxan ndtypeanew wtitle,Numbe erofsales,an ndthenpress sENTER.Thefieldlabelha asanewnam meinthe Pivot tTablereport.

Tore emovetheNu umberofSale esfieldclickin ntheValues boxandclick kRemoveField.Thefieldisremoved.

12

Cre eatingaPivot P Tabl leChart


Tocr reateachartfrom f yourpiv vottable,sim mplygotothe Optionstab, selectPivotChart.TheInsertChartd dialogboxand d selec ctthechartyo ouwouldlike etocreateandclickOK. Once eyouhavecre eatedachart tfromyourpi ivottabledat tathePivotC ChartToolsta abwillappear randyouhav vetheoption offormattingthechart.

heDesigntab b,intheChart tStylesgroup p,clicktheMore M button toseeallth hechoices,an ndthenclickthestyleyou Onth want t. greatthingab boutcreating achartfromaPivotTable eisthatthec chartisintera activeandyou ucanactually yfilterdata Theg fromwithinthech hart.Fromth heclassexam mplewehavetheoptionof ffilteringtheSalespersonandtheOrde erDate.

Filte erwithinaPivotTabl leChart


Tofil ltertheSalespersongotothedownwardarrowand dselectthepe ersonyouwo ouldliketose ee.Alsotofilt tertheOrder r Date eclickonthedownward d ar rrowandsele ectthequarte eryouwould liketoview.

13

For rmattingaPivotTa ableChar rt


Unde erLayouttabyouhavethe eoptiontoad ddtitles,axes sandgridline s.ToaddaC ChartTitlegotothePivotTableChart Tools stabandgoto t theLayout ttab.Hereyo ouhavetheoption o ofadd ingacharttit tle.Youcana alsodothisunderthe Desig gntab,intheChartLayoutgroup.Click kthelayoutyou y wantapp pliedtothePi ivotTableCha art.

Unde ertheFormat ttabtherear renumerousoptionstoformatthePivo otTableChart.

ghtclickonthecolumnan ormatthecolu umncolor,outline,effects sgototheFo ormattab.Yo oucanalsorig ndselect Tofo Form matDataSerie es.TheForm matDataSeri iesdialogbo oxwillopeng givingyouthe eoptiontoformatthecolu umns.You canf fillthecolumn nwithcolorby b goingtoSo olidFilloryou ucanaddPict tureorTextu uretothefillaswell.Once eyouhave made eyourchange esclickClose.

14

Toch hangethetex xtonthePivo otTableChart tgototheFo ormattaband dgowithinth heWordArtStylesandyou ucanchange thec colorandstyle eofthetextas a wellasadd doutlinestothe t textinth echart.

InaP PivotTablech hartyoualsohavetheoptiontoinsertaslicer.Got tothePivotT TableChartTo oolstabandclickonthe Analy yzetab.ObservetheInse ertSlicericonandselectin nsertslicer.S electthefield dnameyouw wouldliketoaddasa slicer randclickOK K. Youcanalsoprotect p yourpivottableby ygoingtothe eHometab,t theCellsgrou upandclicko ontheFormat tdownward TIP:Y arrow w.SelectPro otectSheet.

Itwillthenpromp ptyouwithadialogboxtoenterapasswordaswell astospecifyanyexceptio onsthereadermayhavein n mani ipulatingyourworksheet.Onceyouha avesetthepa asswordclick OK. Toun nlockthesheetsimplygoto t theHometabandselec ctFormat,an ndthenselect tUnprotectS Sheet.

Ifyou uloseorfo orgetyour rpassword ditisNOTretrievabl le.

15

Você também pode gostar