<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Anthony DeBarros &#187; Excel</title>
	<atom:link href="http://www.anthonydebarros.com/category/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anthonydebarros.com</link>
	<description>Data, journalism, code &#38; life</description>
	<lastBuildDate>Sat, 21 Aug 2010 22:05:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sorting Data in Excel: Simple Analysis</title>
		<link>http://www.anthonydebarros.com/2010/05/12/sorting-data-in-excel-simple-analysis/</link>
		<comments>http://www.anthonydebarros.com/2010/05/12/sorting-data-in-excel-simple-analysis/#comments</comments>
		<pubDate>Wed, 12 May 2010 04:00:45 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.anthonydebarros.com/?p=552</guid>
		<description><![CDATA[Sorting a data set helps answer a basic question journalists like to ask: &#8220;Which ____ has the highest (or lowest) ______?&#8221; Excel (and other spreadsheets such as the open source Calc) make sorting data easy. In fact, I often make sorting my first step when &#8220;interviewing&#8221; data because it quickly reveals high and low values [...]]]></description>
			<content:encoded><![CDATA[<p>Sorting a data set helps answer a basic question journalists like to ask: &#8220;Which ____ has the highest (or lowest) ______?&#8221;</p>
<p>Excel (and other spreadsheets such as the open source <a href="http://www.openoffice.org/" target="_blank">Calc</a>) make sorting data easy. In fact, I often make sorting my first step when &#8220;interviewing&#8221; data because it quickly reveals high and low values and often highlights some that may seem questionable.</p>
<p>Let&#8217;s work through a simple sort in Excel. I&#8217;ll be using Excel 2007, but older versions have similar functions. Start by <a href="http://www.anthonydebarros.com/wp-content/themes/portfolio_ad/docs/sorting.xls" target="_blank">downloading the file &#8220;sorting.xls&#8221;</a> and saving it to your computer. Open it and follow along:</p>
<p>1. We have a table of Census data from the 2006-2008 American Community Survey. It shows the median age of the population for each of 79 school districts in Virginia plus the state itself.</p>
<p><img class="alignnone size-full wp-image-567" style="border: 0pt none;" title="sorting1" src="http://www.anthonydebarros.com/wp-content/uploads/2010/05/sorting11.jpg" alt="" width="450" height="318" /></p>
<p>We want to know which district has the oldest and youngest populations. Let&#8217;s sort it!</p>
<p>2. Click once on one cell anywhere in the table. This will help Excel auto-discover your table in the next step.</p>
<p><img class="alignnone size-full wp-image-571" title="sorting2" src="http://www.anthonydebarros.com/wp-content/uploads/2010/05/sorting21.jpg" alt="" width="450" height="315" /></p>
<p><span id="more-552"></span><br />
3. On the Excel ribbon, select the &#8220;Data&#8221; tab and click &#8220;Sort.&#8221;</p>
<p><img class="alignnone size-full wp-image-573" title="sorting3" src="http://www.anthonydebarros.com/wp-content/uploads/2010/05/sorting3.jpg" alt="" width="400" height="284" /></p>
<p>4. Two things happened. One, your entire table was selected (or highlighted). Two, a dialog box popped up to offer sorting options. Check off &#8220;My data has headers.&#8221; That will prevent your header row from getting sorted with the data, and it will add the three column names under the &#8220;Sort by&#8221; drop down.</p>
<p>5. Under &#8220;Sort by,&#8221; select &#8220;Median.&#8221; Under &#8220;Order,&#8221; select &#8220;Largest to Smallest.&#8221;</p>
<p><img class="alignnone size-full wp-image-578" title="sorting4" src="http://www.anthonydebarros.com/wp-content/uploads/2010/05/sorting4.jpg" alt="" width="450" height="311" /></p>
<p>6. Click &#8220;OK.&#8221; Excel sorts your table, ranking the districts by median age &#8212; from highest to lowest. Your first few rows should look like this:</p>
<p><img class="alignnone size-full wp-image-581" title="sorting5" src="http://www.anthonydebarros.com/wp-content/uploads/2010/05/sorting5.jpg" alt="" width="450" height="300" /></p>
<p>Now, we can do a quick scan and look for patterns. For example, several of the &#8220;oldest&#8221; counties are in southern Virginia, far away from the Northern Virginia economic engine. Meanwhile, the district with the lowest age is Harrisonburg City Public Schools &#8212; with a median age of a barely-legal 22.8. Could the fact that the city hosts <a href="http://www.emu.edu/" target="_blank">two</a> <a href="http://www.jmu.edu/" target="_blank">universities</a> have something to do with that?</p>
<p>Good fodder for reporting, all made possible by a simple Excel sort.</p>
<p>A couple of tips and cautions:</p>
<p>&#8211; A good general practice is to work on a copy of your original data. Because things happen.</p>
<p>&#8211; Excel does best at sorting when your table has a header row and is not contiguous to any unrelated data, such as footnotes. Insert blank rows and columns between the data you want to sort and any information you want to keep separate.</p>
<p>&#8211; I recommend selecting only one cell in your table before selecting the &#8220;Sort&#8221; button. If you grab more than one, Excel may attempt to sort only those cells rather than the whole table. The 2007 version asks if you want to expand the selection, but older versions sometimes do not. This creates the possibility that only some of your data would get sorted, which is a nightmare. Always make sure your entire table gets selected!</p>
<p>&#8211; You can sort by more than one field. In Excel 2007, click &#8220;Add level&#8221; in the sort dialog.</p>
<p>Questions? Tips of your own? Add them below &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonydebarros.com/2010/05/12/sorting-data-in-excel-simple-analysis/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mean vs. Median: A Beginner&#8217;s Guide</title>
		<link>http://www.anthonydebarros.com/2009/12/27/mean-vs-median-excel/</link>
		<comments>http://www.anthonydebarros.com/2009/12/27/mean-vs-median-excel/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 03:53:26 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.anthonydebarros.com/?p=291</guid>
		<description><![CDATA[A common way to summarize a group of numbers &#8212; one most of us learned in grade school &#8212; is to find its mean, commonly called the average. But it&#8217;s not always the best measure. Let&#8217;s say six kids go on a field trip, ages 10, 11, 10, 9, 13 and 12. It&#8217;s easy to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>A common way to summarize </strong>a group of numbers &#8212; one most of us learned in grade school &#8212; is to find its mean, commonly called the average. But it&#8217;s not always the best measure.</p>
<p>Let&#8217;s say six kids go on a field trip, ages 10, 11, 10, 9, 13 and 12. It&#8217;s easy to add the ages and divide by six to get the group&#8217;s average age:</p>
<blockquote><p><code>(10 + 11 + 10 + 9 + 13 + 12) / 6 = <b>10.8</b></code></p></blockquote>
<p>Because all the ages are close, the average of 10.8 gives us a good picture of the group as a whole. But averages are less helpful when the values are skewed toward one end or if they include outliers.</p>
<p>For example, what if we add a much older chaperone to our field trip? With ages of 10, 11, 10, 9, 13, 12 and 46, the average age of the group rises considerably:</p>
<blockquote><p><code>(10 + 11 + 10 + 9 + 13 + 12 + 46) / 7 = <b>15.9</b></code></p></blockquote>
<p>Now the mean is not an accurate representation. The outlier skews the average, and no journalist should feel comfortable reporting it.</p>
<p>This is where calculating a median is handy. The median is the midpoint in an ordered list of values &#8212; the point at which half the values are higher and half lower. If the median household income in East Middletownburg is $50,000, then half the households earn more and half less.</p>
<p><span id="more-291"></span>Using our field trip, we order the ages from lowest to highest: </p>
<blockquote><p><code>9, 10, 10, <b>11</b>, 12, 13, 46</code></p></blockquote>
<p>The middle value is 11, and that&#8217;s the median. Half the values are higher, and half lower. If there had been an even number of values, we&#8217;d average the two middle values to find the median. For larger sets of numbers, you can use the MEDIAN function in Microsoft Excel.</p>
<p>Given this group, the median of 11 is a much better representation of the typical age than the average of 15.9. That&#8217;s what makes median such a useful statistical measure. Scan financial news, and you&#8217;ll see medians reported frequently. Reports on housing prices often use medians because a few sales of McMansions in a zip code that&#8217;s otherwise modest can make averages useless. Same for sports player salaries where one or two superstars can skew results.</p>
<p>A good test: calculate the average and the median for a group of values. If they&#8217;re close, then the group is probably normally distributed (the familiar bell curve), and the average is useful. If they&#8217;re far apart, then the values are not normally distributed and the median is the better representation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonydebarros.com/2009/12/27/mean-vs-median-excel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adjusting for inflation: A beginner&#8217;s guide</title>
		<link>http://www.anthonydebarros.com/2009/11/01/adjusting-for-inflation-guide/</link>
		<comments>http://www.anthonydebarros.com/2009/11/01/adjusting-for-inflation-guide/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 03:21:26 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Census]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.anthonydebarros.com/?p=130</guid>
		<description><![CDATA[When Daniel Craig hit theaters last year in Quantum of Solace, the 22nd film in the James Bond spy series, his ability to dispatch bad guys (and charming good looks, no doubt) helped it earn $168.4 million. That was enough to rank Solace among the top 10 grossing films of 2008. But how did Solace [...]]]></description>
			<content:encoded><![CDATA[<p><strong>When Daniel Craig</strong> hit theaters last year in <a href="http://www.007.com/" target="_blank"><em>Quantum of Solace</em></a>, the 22nd film in the James Bond spy series, his ability to dispatch bad guys (and charming good looks, no doubt) helped it earn $168.4 million. That was enough to rank <em>Solace</em> among the <a href="http://boxofficemojo.com/yearly/chart/?yr=2008" target="_blank">top 10 grossing films of 2008</a>.</p>
<p>But how did <em>Solace </em>fare against the rest of the Bond canon, which stretches back to 1963&#8242;s <em>Dr. No</em>? The answer depends on whether you adjust for <a href="http://en.wikipedia.org/wiki/Inflation" target="_blank">inflation</a>.</p>
<p>We all know that the price of a loaf of bread isn&#8217;t what it used to be. The cost of consumer goods tends to rise each year, except during downturns or various calamities. So, taking inflation (or <a href="http://en.wikipedia.org/wiki/Deflation" target="_blank">deflation</a>) into account is the only way to  meaningfully compare dollar amounts over time.</p>
<p>There are plenty of apps just for this. The Bureau of Labor Statistics offers one <a href="http://data.bls.gov/cgi-bin/cpicalc.pl" target="_blank">basic calculator</a>, and there&#8217;s another at <a href="http://www.usinflationcalculator.com/" target="_self">this site</a>. They&#8217;re fine for a quick check, but I&#8217;d rather do my own calculations. A web app might not have the latest data. And if you&#8217;re adjusting more than a couple of amounts, using a spreadsheet will save time. Here&#8217;s an exercise from Bond-land:</p>
<p><span id="more-130"></span></p>
<p>Let&#8217;s compare the $168.4 million <em>Quantum of Solace</em> earned in 2008 to the $35.4 million earned by 1973&#8242;s <em>Live and Let Die.</em> In 2008 dollars, which movie earned more?</p>
<p>Finding out is fairly straightforward:</p>
<p>1. Get the index that measures the cost of goods and services. In the U.S., the most widely cited is the Consumer Price Index for All Urban Consumers, aka the CPI-U. The Bureau of Labor Statistics&#8217; main page on the CPI is <a href="http://www.bls.gov/CPI/" target="_blank">here</a>, and you should spend some time on the <a href="http://www.bls.gov/cpi/cpifaq.htm" target="_blank">FAQ</a>. The index values are in <a href="ftp://ftp.bls.gov/pub/special.requests/cpi/cpiai.txt" target="_blank">this table</a>, which goes back to 1913. It also has the annual average and the yearly <a href="../2009/10/14/percent-change-the-formula/" target="_blank">percent change</a> in both the annual average and the December values.</p>
<p>2. For this exercise, we&#8217;ll use the average CPI-U values for 1973 (44.4) and 2008 (215.303). Because the CPI-U includes relatively volatile items such as food and fuel, I tend to avoid the monthly values with their fluctuations. If you want to adjust to the most recent data available, consider averaging the most recent six months of CPI-U values.</p>
<p>3. Multiply the 1973 film&#8217;s gross times the 2008 CPI-U average. Divide that product by the 1973 CPI-U average. Here&#8217;s the setup:</p>
<p><code>2008_value = (1973_amount * 2008_CPI-U) / 1973_CPI-U</code></p>
<p>With the numbers plugged in, we have:</p>
<p><code>2008_value = ($35,377,836 * 215.303) / 44.4 </code></p>
<p>Always remember that operations in parenthesis happen first. Do the math, and we get:</p>
<p><code>2008_value = $171,553,023</code></p>
<p>So, though <em>Quantum of Solace&#8217;s </em>$168.4 million was hefty, after adjusting for inflation it&#8217;s about even with what <em>Live and Let Die&#8217;s </em>original box office is worth today.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonydebarros.com/2009/11/01/adjusting-for-inflation-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Percent change: Know the formula</title>
		<link>http://www.anthonydebarros.com/2009/10/14/percent-change-the-formula/</link>
		<comments>http://www.anthonydebarros.com/2009/10/14/percent-change-the-formula/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 02:35:09 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.anthonydebarros.com/?p=110</guid>
		<description><![CDATA[Here&#8217;s a question I posed to some college students recently: Let&#8217;s say you cover the Town of East Middleburgtown. The mayor announces that this year&#8217;s town budget comes in at $12.6 million. Last year&#8217;s budget was $11.4 million. What is the percent change? Better yet, what&#8217;s the formula for figuring it out? If you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Here&#8217;s a question</strong> I posed to some college students recently:</p>
<p><em>Let&#8217;s say you cover  the Town of East Middleburgtown. The mayor announces that this year&#8217;s town budget comes in at $12.6 million. Last year&#8217;s budget was $11.4 million. What is the percent change? Better yet, what&#8217;s the formula for figuring it out?</em></p>
<p>If you don&#8217;t know the answer, or how to obtain it, you&#8217;re not alone. This kind of problem &#8212; which is in my son&#8217;s 7th grade math textbook &#8212; routinely stumps most journalists in most of the newsrooms across America.</p>
<p>I&#8217;ll avoid the temptation to moralize here. If you&#8217;re a journalist &#8212; if you have a pulse &#8212; you need to know this very basic operation. With it, you&#8217;ll have the power to analyze all kinds of data and even double-check the mayor&#8217;s math.</p>
<p>Here it is:</p>
<blockquote><p><code>(the_new_number - the_original_number) / the_original_number</code></p></blockquote>
<p>or, in the case of East Middletownburg:</p>
<blockquote><p><code>(12.6-11.4) / 11.4</code></p></blockquote>
<p>Remember (and you learned this in fifth grade) that operations in parentheses come first. That gives you this:</p>
<blockquote><p><code>1.2 / 11.4 = .105 = 10.5%<br />
</code></p></blockquote>
<p>So, the mayor&#8217;s new budget is a 10.5% increase over last year&#8217;s. Now you have something to write about!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonydebarros.com/2009/10/14/percent-change-the-formula/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Excel: Combine text and formulas in a cell</title>
		<link>http://www.anthonydebarros.com/2009/10/04/excel-concatenate/</link>
		<comments>http://www.anthonydebarros.com/2009/10/04/excel-concatenate/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 17:46:36 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.anthonydebarros.com/?p=76</guid>
		<description><![CDATA[Whenever I analyze data in Excel, I format the spreadsheet to make it easier to read. A little attention to fonts, boxes and shading can help people understand the key data faster. One way to give yourself some flexibility with formatting is to combine text and the results of a formula in a single cell. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Whenever I analyze data in Excel, </strong>I format the spreadsheet to make it easier to read. A little attention to fonts, boxes and shading can help people understand the key data faster.</p>
<p>One way to give yourself some flexibility with formatting is to combine  text and the results of a formula in a single cell. Just use the &#8220;&amp;&#8221; operator to concatenate the text and the formula.</p>
<p>Consider this formula:</p>
<p><code>="Quantity: "&amp;SUM(A1:A20)</code></p>
<p>Enter it into a cell, press enter and (assuming you have numeric values in cells A1 through A20) it will present this result in a single cell:</p>
<p><code>Quantity: 23</code></p>
<p>That kind of output&#8217;s pretty handy when you want to create a worksheet in your spreadsheet that aggregates data from other sheets while keeping the formatting simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonydebarros.com/2009/10/04/excel-concatenate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
