Today’s author, Monica Poinescu, a Software Developer in Test on the Excel team, discusses two different approaches to analyzing data in Excel.
Edit: I've attached a file at the bottom of this blog that contains spreadsheets of the examples discussed in this post.
My earlier blog on the new Excel 2007 function SUMIFS spawned a very interesting discussion (thanks to everyone who posted comments there): when trying to analyze/aggregate data in a table, how do we decide whether to use functions versus PivotTables?
This blog outlines reasons to use one option or another. To better illustrate the two alternatives I’ll consider a real estate inspired example: let’s say I have list of homes for sale and their corresponding characteristics:
and I’m trying to find the average price for those homes which have at least 3 bedrooms, a garage and are between 5 and 10 years old. Just by looking at the table, we see that only house3 and house4 satisfy all conditions and the average of their prices is 312,500.
Here is a functions based solution:
=AVERAGEIFS(G2:G6,C2:C6,">2",E2:E6,"yes",F2:F6,">1999",F2:F6,"<2004")
which returns $ 312,500.
To build a corresponding PivotTable, one can use several filters:
Advantages of PivotTables:
Advantages of using functions:
Note that in both cases you can use the wildcard characters to define criteria. Also both solutions deal in a similar manner with missing data or errors in the range.
I don't know if I can be fully objective on this question because I'm more of a formula person myself. If I've missed a reason you should pick one approach over another, feel free to let me know the reason you use formulas or PivotTables for summarizing data by leaving a comment.
Code/Templates/Informaiton provided on this site are without any liabilities. Owner of this website in no event will be held reponsible to damages resulting by using the code/templates/applications/
Copyright © 2003 xlMacros.com - Learn Excel VBA
Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Excel Password Cracker Addin.
For $10 Today. Price back to $20 tommorow.
Never Worry About Lost Excel Passwords!!!
Remove Excel Password - the easy way has never been easier than this.