<?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/"
	>

<channel>
	<title>Daily Dose of Excel</title>
	<atom:link href="http://www.dailydoseofexcel.com/index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com</link>
	<description>Daily posts of Excel tips...and other stuff</description>
	<pubDate>Wed, 10 Mar 2010 20:43:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using the MATCH Function for a Linear Search and a Binary Search</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/10/using-the-match-function-for-a-linear-search-and-a-binary-search/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/10/using-the-match-function-for-a-linear-search-and-a-binary-search/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 20:43:01 +0000</pubDate>
		<dc:creator>Tushar Mehta</dc:creator>
		
		<category><![CDATA[Downloads]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3673</guid>
		<description><![CDATA[Given the problem I have with images and blog posts, I&#8217;m trying something new.  I uploaded the content of the post to my website and am using an iframe to post it here.  Yes, the UI experience is somewhat different than scrolling the entire browser window but hopefully it is something most people [...]]]></description>
			<content:encoded><![CDATA[<p>Given the problem I have with images and blog posts, I&#8217;m trying something new.  I uploaded the content of the post to my website and am using an iframe to post it here.  Yes, the UI experience is somewhat different than scrolling the entire browser window but hopefully it is something most people will be OK with.  And, yes, I can adjust both the height and the width of the iframe.</p>
<p>This approach has another benefit in that one can read the entire post on the home page itself.</p>
<p><iframe src="http://www.tushar-mehta.com/publish_train/xl_vba_cases/match-exact-vs-binary.htm" style="width:100%;height:600px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/10/using-the-match-function-for-a-linear-search-and-a-binary-search/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Keno Odds</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/09/keno-odds/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/09/keno-odds/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 21:37:44 +0000</pubDate>
		<dc:creator>Dick Kusleika</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3682</guid>
		<description><![CDATA[We were trying to figure out the odds on keno the other day.  There&#8217;s something about statistics that doesn&#8217;t create appropriately strong synapses in my brain.  I got an A in stats in college, so I know I can retain the information long enough to be tested on it.  But put me [...]]]></description>
			<content:encoded><![CDATA[<p>We were trying to figure out the odds on keno the other day.  There&#8217;s something about statistics that doesn&#8217;t create appropriately strong synapses in my brain.  I got an A in stats in college, so I know I can retain the information long enough to be tested on it.  But put me in a bar and make me figure out odds on craps or blackjack or keno and I&#8217;m lost.  Thank goodness for the <a href="http://talkstats.com/archive/index.php/t-551.html">internet.</a></p>
<p>The formula for determining pick/catch odds at keno is</p>
<p><code class="codecolorer text default"><span class="text">=COMBIN(20,Caught)*COMBIN(80-20,Picked-Caught)/COMBIN(80,Picked)</span></code></p>
<p>Keno is a game where to 20 numbers are selected out of 80.  You can pick numbers that you think will show up in the 20.  The number that actually do are &#8220;caught&#8221;.  What&#8217;s the best play?  I start with a matrix of picks and catches and the odds of each.</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/kenoodds1.gif" height="297" width="640" alt="" /></p>
<p>Then I create a matrix of payouts for all the cominations</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/kenoodds2.gif" height="263" width="539" alt="" /></p>
<p>Finally I multiply the top table by the bottom table.  This is my expected payout for $1 bet.  </p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/kenoodds3.gif" height="253" width="605" alt="" /></p>
<p>I sum up all the expected payouts for a pick and</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/kenoodds4.gif" height="400" width="400" alt="" /></p>
<p>Let&#8217;s set aside the fact that the best play is not to play.  If you don&#8217;t play, $1 yields $1.  The next best option is picking one number.  If you pick-1 long enough, you&#8217;ll only lose $.25 for every $1 bet.  Pick-20 is so bad, in part, because our local keno jobber has a maximum payout of $50,000.  If you pick 20 and catch 20 you get $50,0000.  If you pick 15 and catch 15, it&#8217;s a $50,000 payout.  With the cap, longer odds don&#8217;t pay.  If you pick-8 long enough, you&#8217;ll lose $.44 for every $1 bet.</p>
<p>I put this to the test last Friday night by playing five $1 pick-1 games.  I won three of them for a net profit of $4.  I&#8217;m sure you&#8217;ll agree that five games isn&#8217;t statistically significant.  And to be honest, I don&#8217;t need to &#8220;prove&#8221; the math; I think it stands on its own.  But in the interest of science, I&#8217;m going to the local pizza and beer merchant to play 80 $.25 games of pick-1.  I should lose $5.</p>
<p>You can <a href="http://dailydoseofexcel.com/excel/kenoodds.zip">download kenoodds.zip</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/09/keno-odds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting Array Data from a Filtered List in VBA</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/08/getting-array-data-from-a-filtered-list-in-vba/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/08/getting-array-data-from-a-filtered-list-in-vba/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 21:50:31 +0000</pubDate>
		<dc:creator>Dick Kusleika</dc:creator>
		
		<category><![CDATA[Arrays]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3669</guid>
		<description><![CDATA[Getting data from an Excel sheet into an array is usually best accomplished with a statement that looks something like this:
vMyArray = Sheet1.UsedRange.Value
I thought it would be keen to fill an array from a filtered list, so I coded
Sub ArrFilteredList()
&#160; &#160; 
&#160; &#160; Dim vArr As Variant
&#160; &#160; 
&#160; &#160; vArr = Sheet1.UsedRange.SpecialCells(xlCellTypeVisible).Value
&#160; &#160; 
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Getting data from an Excel sheet into an array is usually best accomplished with a statement that looks something like this:</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vMyArray = Sheet1.UsedRange.Value</div></div>
<p>I thought it would be keen to fill an array from a filtered list, so I coded</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">Sub</span> ArrFilteredList()<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> vArr <span style="color: #000080;">As</span> <span style="color: #000080;">Variant</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; vArr = Sheet1.UsedRange.SpecialCells(xlCellTypeVisible).Value<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Stop</span><br />
&nbsp; &nbsp; <br />
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></div></div>
<p>on this list</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/arrayfiltered.gif" height="290" width="441" alt="" /></p>
<p>The SpecialCells returns a range of only those cells that are visible, i.e. unfiltered in this case.  The problem, it turns out, is that this method doesn&#8217;t work with noncontiguous ranges and that&#8217;s just what SpecialCells returns.  I put the Stop in there so I could check the Locals Window.</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/arrfilteredlocals.gif" height="254" width="454" alt="" /></p>
<p>It filled from the first Area of the range, then stopped.  I confirmed that it was the lack of continutity of the range with this code</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">Sub</span> ArrNonContiguous()<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> vArr <span style="color: #000080;">As</span> <span style="color: #000080;">Variant</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; vArr = Union(Sheet1.Range(<span style="color: #800000;">&quot;A1:C1&quot;</span>), Sheet1.Range(<span style="color: #800000;">&quot;A4:C6&quot;</span>)).Value<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Stop</span><br />
&nbsp; &nbsp; <br />
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></div></div>
<p>which returned similar results.  So I&#8217;m stuck iterating through the range, I guess.  But then my array is backward; column, row instead row, column because I can&#8217;t change the first element of an array with Redim Preserve.</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">Sub</span> ArrFilteredList2()<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> rRow <span style="color: #000080;">As</span> Range<br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> aArr() <span style="color: #000080;">As</span> <span style="color: #000080;">String</span><br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> i <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span><br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> lCount <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">ReDim</span> aArr(1 <span style="color: #000080;">To</span> 3, 1 <span style="color: #000080;">To</span> Sheet1.UsedRange.Rows.Count)<br />
&nbsp; &nbsp; lCount = 0<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> rRow <span style="color: #000080;">In</span> Sheet1.UsedRange.Rows<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">If</span> rRow.Hidden = <span style="color: #000080;">False</span> <span style="color: #000080;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lCount = lCount + 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">To</span> 3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aArr(i, lCount) = rRow.Cells(i).Value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">Next</span> i<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">End</span> <span style="color: #000080;">If</span><br />
&nbsp; &nbsp; <span style="color: #000080;">Next</span> rRow<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">ReDim</span> <span style="color: #000080;">Preserve</span> aArr(1 <span style="color: #000080;">To</span> 3, 1 <span style="color: #000080;">To</span> lCount)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Stop</span><br />
&nbsp; &nbsp; <br />
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></div></div>
<p>Is there a better way?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/08/getting-array-data-from-a-filtered-list-in-vba/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Plain and Pretty</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/05/plain-and-pretty/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/05/plain-and-pretty/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 11:30:44 +0000</pubDate>
		<dc:creator>Dick Kusleika</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3659</guid>
		<description><![CDATA[Mike Alexander tells me that I have to sell, so sell I shall.


First, the pretty:



Microsoft MVPs Jon Peltier (Peltier Technical Services) and Mike Alexander (DataPig Technologies)  are joining together again to bring you our acclaimed Excel Dashboard and Visualization Bootcamp!
This 3-day boot camp is designed for Excel users who need to more effectively synthesize [...]]]></description>
			<content:encoded><![CDATA[<p>Mike Alexander tells me that I have to sell, so sell I shall.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/TROhlThs9qY&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TROhlThs9qY&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<hr />
<p>First, the pretty:</p>
<table><col width="60%" /><col width="40%" /><br />
<tr>
<td>
<blockquote><p>Microsoft MVPs Jon Peltier (<a href="http://peltiertech.com/">Peltier Technical Services</a>) and Mike Alexander (<a href="http://www.datapigtechnologies.com/">DataPig Technologies</a>)  are joining together again to bring you our acclaimed Excel Dashboard and Visualization Bootcamp!</p>
<p>This 3-day boot camp is designed for Excel users who need to more effectively synthesize data into meaningful dashboards, charts, and visualizations.  The topics presented during this boot camp will introduce you to advanced techniques that will help you build and manage better reporting mechanisms.  Going beyond simple tables and charts, you will learn to:</p>
<p>    * Synthesize data in meaningful views with advanced charting techniques<br />
    * Create reports and dashboards that communicate and get noticed<br />
    * Create interactive reporting mechanisms<br />
    * Implement macro-charged reporting<br />
    * Automate the creation of PowerPoint slides directly from Excel<br />
    * Integrate external data into your reports</p></blockquote>
</td>
<td><img src="http://www.dailydoseofexcel.com/blogpix/PeltierBanner.gif" height="216" width="424" align="right" alt="" /></td>
</tr>
</table>
<hr />
<p>And for those of us who love data and don&#8217;t need pretty pictures, the plain:</p>
<table><col width="60%" /><col width="40%" /><br />
<tr>
<td>
<blockquote><p>Microsoft MVPs Dick Kusleika (Daily Dose of Excel) and Mike Alexander (<a href="http://www.datapigtechnologies.com/">DataPig Technologies</a>)  bring you our first ever Excel and Access Power User Workshop!</p>
<p>This 3-day workshop is designed for power users who what to expand their skill-set and get more out of Excel and Access.  During this workshop, you&#8217;ll be introduced to a wide array of tips and techniques that will muscle up your skills in Data Reporting, Automation, and Application Development. </p>
<p>The topics presented during this 3-day workshop will help you go beyond basic spreadsheets and databases, to to robust professional-grade solutions.  Learn how to:  </p>
<p>    * Move Data between Excel and Access using MSQuery and SQL<br />
    * Use ADO Scripting to build robust data entry models in Excel<br />
    * Automate Excel from Access<br />
    * Run Access Processes from Excel<br />
    * Automate Outlook Interactions<br />
    * Building client-side solutions that use SQL server as the back end </p></blockquote>
</td>
<td><img src="http://www.dailydoseofexcel.com/blogpix/KusleikaBanner.gif" height="212" width="346" align="right" alt="" /></td>
</tr>
</table>
<hr />
<p>And now the closer:</p>
<p><strong>Sign up before April 1st and save $200 on your registration. On April 1st, prices return to $800.</strong></p>
<p>OK, I feel sufficiently dirty now.  But these are going to great workshops, so go sign up now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/05/plain-and-pretty/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Office Automation</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/04/office-automation/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/04/office-automation/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:00:58 +0000</pubDate>
		<dc:creator>Dick Kusleika</dc:creator>
		
		<category><![CDATA[Polls]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3653</guid>
		<description><![CDATA[Someone asked if anyone automates Office applications any more.  That struck me as kind of funny.  If I had to guess, I would guess that there are more lines of VBA code (poorly written or not) that automate Office applications than all the COBOL, VB6, PHP, and any other language you can think [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked if anyone automates Office applications any more.  That struck me as kind of funny.  If I had to guess, I would guess that there are more lines of VBA code (poorly written or not) that automate Office applications than all the COBOL, VB6, PHP, and any other language you can think of doing anything.  I don&#8217;t have any evidence of that.  It&#8217;s in the Outlook-is-the-largest-data-store vein.  Because there are so many Excel, Word, Access, etc documents out there, I think all the code in them would add up to a bunch.  What do you think?</p>
<p><!-- // Begin Pollhost.com Poll Code // --></p>
<form method=post action=http://poll.pollhost.com/vote.cgi>
<table border=0 width=150 bgcolor=#FFFFFF cellspacing=0 cellpadding=2>
<tr>
<td colspan=2><font face="Arial" size=-1 color="#000000"><b>There are more lines of VBA code automating Office apps than all other kinds of code doing all other tasks</b></font></td>
</tr>
<tr>
<td width=5>
<input type=radio name=answer value=1 /></td>
<td><font face="Arial" size=-1 color="#000000">True</font></td>
</tr>
<tr>
<td width=5>
<input type=radio name=answer value=2 /></td>
<td><font face="Arial" size=-1 color="#000000">False</font></td>
</tr>
<tr>
<td width=5>
<input type=radio name=answer value=3 /></td>
<td><font face="Arial" size=-1 color="#000000">Can&#8217;t/Won&#8217;t Guess</font></td>
</tr>
<tr>
<td colspan=2>
<input type=hidden name=config value="ZGt1c2xlaWthCTEyNjc2NTAxMjgJRkZGRkZGCTAwMDAwMAlBcmlhbAlBc3NvcnRlZA" /><center><br />
<input type=submit value=Vote />&nbsp;&nbsp;<br />
<input type=submit name=view value=View /></center></td>
</tr>
<tr>
<td bgcolor=#FFFFFF colspan=2 align=right><font face="Arial" size=-2 color="#000000"><a href=http://www.pollhost.com/></font><font color=#000099>Free polls from Pollhost.com</font></td>
</tr>
</table>
</form>
<p><!-- // End Pollhost.com Poll Code // --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/04/office-automation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerPivot - Part 3 of 4: Conditional Shape Colors</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/02/powerpivot-part-3-of-4-conditional-shape-colors/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/02/powerpivot-part-3-of-4-conditional-shape-colors/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 02:13:11 +0000</pubDate>
		<dc:creator>Tushar Mehta</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3640</guid>
		<description><![CDATA[Part 1: http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/
Part 2: http://www.dailydoseofexcel.com/archives/2010/02/27/powerpivot-part-2-of-4-prepping-the-census-data/
As mentioned in the Part 1, I had developed this technique to conditionally color shapes some time ago.  Based on customer feedback and my own experience I made changes to simplify the various connections required to make it all work.
Also, documenting the technique was easier to do with a webpage [...]]]></description>
			<content:encoded><![CDATA[<p>Part 1: <a target="new" href="http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/">http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/</a></p>
<p>Part 2: <a target="new" href="http://www.dailydoseofexcel.com/archives/2010/02/27/powerpivot-part-2-of-4-prepping-the-census-data/">http://www.dailydoseofexcel.com/archives/2010/02/27/powerpivot-part-2-of-4-prepping-the-census-data/</a></p>
<p>As mentioned in the Part 1, I had developed this technique to conditionally color shapes some time ago.  Based on customer feedback and my own experience I made changes to simplify the various connections required to make it all work.</p>
<p>Also, documenting the technique was easier to do with a webpage for two reasons: 1) the length of the post, and 2) I find the UI for a blog post somewhat cumbersome for managing images.  </p>
<p>The updated solution is at <a target="new" href="http://www.tushar-mehta.com/publish_train/xl_vba_cases/0301-dashboard-conditional_shape_colors.htm">http://www.tushar-mehta.com/publish_train/xl_vba_cases/0301-dashboard-conditional_shape_colors.htm</a></p>
<p>In Part 4, the last part of this multi-part post, I will look at using PowerPivot from within Excel to analyze the 18 million row data set generated in Part 2 and on integrating the result with the Conditional Shape Color solution of this post. </p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/picture11.png" alt="picture11" title="picture11" width="461" height="313" class="aligncenter size-full wp-image-3641" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/02/powerpivot-part-3-of-4-conditional-shape-colors/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web Query Lessons</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/02/web-query-lessons/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/02/web-query-lessons/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 14:57:31 +0000</pubDate>
		<dc:creator>Dick Kusleika</dc:creator>
		
		<category><![CDATA[External Data]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3634</guid>
		<description><![CDATA[I&#8217;ve recently learned some things about Web Queries that I&#8217;d like to share with you. But first a little background.  You create a Web Query in Excel 2007 by clicking From Web on the Data tab.  This launches a browser within Excel through which you navigate to a web page and select a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently learned some things about Web Queries that I&#8217;d like to share with you. But first a little background.  You create a Web Query in Excel 2007 by clicking From Web on the Data tab.  This launches a browser within Excel through which you navigate to a web page and select a &#8220;table&#8221;.  Tables on web pages can be a few different things.  I think the common &#8220;tables&#8221; are html tables and html div tags.</p>
<p>Lesson 1: The web browser Excel uses is some variant of Internet Explorer.  If you don&#8217;t use IE, and I don&#8217;t, then you haven&#8217;t bothered to set the home page.  In that case, the home page will be msn.com and you might see errors like this:</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/webqueryerror.gif" height="286" width="432" alt="" /></p>
<p>Awesome.  Why did I ever stop using IE?  If I open IE8, set my home page to google.com (or anything else), then the errors go away.  Bonus April Fools day tip: Find a co-worker who uses Firefox and set his IE home page to <a href="http://hawtness.com/">hawtness.com</a>.  It&#8217;s marginally NSFW, so it will be funny when he does a web query, but he won&#8217;t get fired (probably).</p>
<p>Lesson 2: If you try to refresh a Web Query for a web page that requires you to log in, it won&#8217;t work (sometimes).  You&#8217;ll get</p>
<blockquote><p><a href="http://support.microsoft.com/kb/277596">This Web query returned no data. To modify the query, click OK, click the name of the external data range in the name box on the formula bar, and then click Edit Query on the External Data toolbar.</a></p></blockquote>
<p>I have a workbook with a couple dozen web queries all pointing to the same site.  If I &#8216;edit&#8217; one of the queries, Excel&#8217;s instance of IE remembers that I have logged in (cookies maybe?  that aren&#8217;t shared with normal IE?) and I can refresh all the remaining queries without error.  So I created a sheet near the beginning called &#8216;Credentials&#8217; where I have a Web Query that brings in a small table near the top of the home page.  I &#8216;edit&#8217; that query to log in, but I don&#8217;t have to navigate around much to bring it in.  Then I run my code which updates all the URLs and refreshes all the queries.  The poor man&#8217;s IE automation, I guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/02/web-query-lessons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IsHex Function</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/01/ishex-function/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/03/01/ishex-function/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 22:18:14 +0000</pubDate>
		<dc:creator>Dick Kusleika</dc:creator>
		
		<category><![CDATA[User Defined Functions]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3631</guid>
		<description><![CDATA[I have a need to verify some user input is hexadecimal (0-9 and A-F).
Public Function IsHex(sInput As String) As Boolean
&#160; &#160; 
&#160; &#160; Dim lResult As Long
&#160; &#160; 
&#160; &#160; On Error Resume Next
&#160; &#160; &#160; &#160; lResult = CLng(&#34;&#38;H&#34; &#38; sInput)
&#160; &#160; &#160; &#160; 
&#160; &#160; IsHex = sInput = &#34;0&#34; Or lResult &#62; [...]]]></description>
			<content:encoded><![CDATA[<p>I have a need to verify some user input is hexadecimal (0-9 and A-F).</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">Public</span> <span style="color: #000080;">Function</span> IsHex(sInput <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>) <span style="color: #000080;">As</span> <span style="color: #000080;">Boolean</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> lResult <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; lResult = <span style="color: #000080;">CLng</span>(<span style="color: #800000;">&quot;&amp;H&quot;</span> &amp; sInput)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; IsHex = sInput = <span style="color: #800000;">&quot;0&quot;</span> <span style="color: #000080;">Or</span> lResult &gt; 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></div></div>
<p>With help from <a href="http://www.mrexcel.com/forum/showthread.php?t=379574">this Mr. Excel thread</a>.  So where did &#038;H come from?  Are there more like it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/03/01/ishex-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerPivot - Part 2 of 4: Prepping the census data</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/02/27/powerpivot-part-2-of-4-prepping-the-census-data/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/02/27/powerpivot-part-2-of-4-prepping-the-census-data/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 21:24:35 +0000</pubDate>
		<dc:creator>Tushar Mehta</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3613</guid>
		<description><![CDATA[Part 1: http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/
Since Excel 2007 (and later) can handle a million rows of data, I figured it made sense to explore PowerPivot (PP) with a data set larger than that.  In addition, I have had a long time curiosity about the US census data.  So, this seemed an appropriate time to combine the [...]]]></description>
			<content:encoded><![CDATA[<p>Part 1: <a target="new" href="http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/">http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/</a></p>
<p>Since Excel 2007 (and later) can handle a million rows of data, I figured it made sense to explore PowerPivot (PP) with a data set larger than that.  In addition, I have had a long time curiosity about the US census data.  So, this seemed an appropriate time to combine the two.  After some exploration of www.census.gov, I learned of <a target="new" href="http://usa.ipums.org/usa/index.shtml">http://usa.ipums.org/usa/index.shtml</a>  This is a project of the <a target="new" href="http://www.pop.umn.edu/">Minnesota Population Center</a> of the <a target="new" href="http://www.umn.edu/">University of Minnesota</a>.</p>
<p>Do note that this post is not meant to be a step-by-step tutorial on how to use the IPUMS website.  While it took some time, it took even more effort to understand the census data but an explanation of the data is also not my intent with this post.  The focus is on loading a large data set in PowerPivot.</p>
<p>The final data set I downloaded expanded to nearly 18 million rows of data.  But, it took a while before I got to the point of getting that data set prepped for PP.</p>
<p>A relatively superficial exploration of the IPUMS site led to two conclusions.  One, the result of &#8216;analyze data online&#8217; would yield results online but the result sets were intentionally limited in size.  Two, trying to get detailed data through the &#8216;Create an Extract&#8217; or the &#8216;Download or Revise Extracts&#8217; led to large data sets but of the kind that were intended for use with SPSS, SAS, or STATA.  The data set itself consisted of fixed length columns.  In addition, there was a delimiter at the end of each row record (discovered through trial and error).  </p>
<p>In addition to the data set, the website provided the command sets to load the data into SPSS, SAS, and STATA.</p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/picture1.png" alt="picture1" title="picture1" width="605" height="516" class="aligncenter size-full wp-image-3621" /></p>
<p>The SPSS instructions were fairly helpful in understanding the layout and the content of the data (other than the secret delimiter).</p>
<p>So, for one data set the columns were</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;year &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1-4<br />
&nbsp;datanum &nbsp; &nbsp; &nbsp; &nbsp;5-6<br />
&nbsp;serial &nbsp; &nbsp; &nbsp; &nbsp; 7-14<br />
&nbsp;numprec &nbsp; &nbsp; &nbsp; 15-16<br />
&nbsp;hhwt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;17-20<br />
&nbsp;statefip &nbsp; &nbsp; &nbsp;21-22<br />
&nbsp;county &nbsp; &nbsp; &nbsp; &nbsp;23-26<br />
&nbsp;urban &nbsp; &nbsp; &nbsp; &nbsp; 27<br />
&nbsp;city &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;28-31<br />
&nbsp;citypop &nbsp; &nbsp; &nbsp; 32-36<br />
&nbsp;urbpop &nbsp; &nbsp; &nbsp; &nbsp;37-41<br />
&nbsp;ownershpd &nbsp; &nbsp; 42-43<br />
&nbsp;mortotal &nbsp; &nbsp; &nbsp;44-47<br />
&nbsp;mortamt1 &nbsp; &nbsp; &nbsp;48-52<br />
&nbsp;rentgrs &nbsp; &nbsp; &nbsp; 53-56<br />
&nbsp;hhincome &nbsp; &nbsp; &nbsp;57-63<br />
&nbsp;pernum &nbsp; &nbsp; &nbsp; &nbsp;64-67<br />
&nbsp;perwt &nbsp; &nbsp; &nbsp; &nbsp; 68-71<br />
&nbsp;age &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 72-74<br />
&nbsp;sex &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 75<br />
&nbsp;marst &nbsp; &nbsp; &nbsp; &nbsp; 76<br />
&nbsp;raced &nbsp; &nbsp; &nbsp; &nbsp; 77-79<br />
&nbsp;gradeattd &nbsp; &nbsp; 80-81<br />
&nbsp;occ1950 &nbsp; &nbsp; &nbsp; 82-84<br />
&nbsp;ind1950 &nbsp; &nbsp; &nbsp; 85-87<br />
&nbsp;inctot &nbsp; &nbsp; &nbsp; &nbsp;88-94<br />
&nbsp;ftotinc &nbsp; &nbsp; &nbsp; 95-101</div></div>
<p>In addition, the SPSS instructions also contained information about the text values associated with the numeric codes in the data set.  For example, ownershpd values were:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">value labels ownershpd<br />
00 &quot;N/A&quot;<br />
&nbsp;10 &quot;Owned or being bought&quot;<br />
&nbsp;11 &quot;Check mark (owns?)&quot;<br />
&nbsp;12 &quot;Owned free and clear&quot;<br />
&nbsp;13 &quot;Owned with mortgage or loan&quot;<br />
&nbsp;20 &quot;Rented&quot;<br />
&nbsp;21 &quot;No cash rent&quot;<br />
&nbsp;22 &quot;With cash rent&quot;</div></div>
<p>The above information is important since we can create Excel tables of these number-to-text maps and link them to the data table in PP.</p>
<p>What made the process of getting the data in PP challenging was that PP will not read fixed column width data from a text file though it will read comma delimited text files.  I would have thought this would be elementary but I couldn&#8217;t find any way to get PP to do so.  Maybe, I missed something that would have made the rest of the exercise below unnecessary.</p>
<p>So, as far as I could tell, I had to convert the fixed-column-width text file into a file where the columns were delimited by some character.  I picked the comma.  But, I couldn&#8217;t use Excel (too many records) or Word (too large a file) to do the conversion.  I also tried Notepad and WordPad before falling back on true and tried VB(A).</p>
<p>I did not start with the 18 million record data set.  I used the smaller data set for a single census from the 19th century to explore the structure of the data.  Through trial and error I discovered the secret delimiter at the end of each record.  I also discovered that the software did not summarize the data in any way.  The code that I felt confident I could use for data from all the censuses combined is below.</p>
<p>It&#8217;s not elegant.  It&#8217;s not flexible.  It&#8217;s not meant to be either.  At some point I might be tempted to paste the information about the column names and widths into a Excel worksheet and have the code automagically work off that.  But, for now, the goal was to prep the data for PP.</p>
<p>One interesting thing I did learn was that using FreeFile() twice in succession yields the same integer value.  That, of course, leads to an error when opening the 2nd file.  So, the correct approach is to get a free file number, open that file, and then get a second free file number for another file.</p>
<p>Also, if one were to add up the column widths of the various fields one would get 101 but the record being read has 102 characters.  The last byte is the delimiter that I want to drop.</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">Option</span> <span style="color: #000080;">Explicit</span><br />
<br />
<span style="color: #000080;">Sub</span> writeOneRec(OutF <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>, Rslt <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>)<br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> Yr <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, DataNum <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, Serial <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; NumPrec <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, HHwt <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; StateFIP <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, County <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, Urban <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; City <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, CityPop <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; UrbPop <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; OwnerShip <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, MorgTotal <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; MorgAmt1 <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, RentGross <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; HHIncome <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; PerNum <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>, PerWt <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, Age <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; Sex <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, MarSt <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, Race <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; GradeAtt <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, Occ1950 <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, Ind1950 <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; IncTot <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span>, FamTotInc <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span><br />
&nbsp; &nbsp; <span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span><br />
&nbsp; &nbsp; Yr = Left(Rslt, 4)<br />
&nbsp; &nbsp; DataNum = Mid(Rslt, 5, 2)<br />
&nbsp; &nbsp; Serial = Mid(Rslt, 7, 8)<br />
&nbsp; &nbsp; NumPrec = Mid(Rslt, 15, 2)<br />
&nbsp; &nbsp; HHwt = Mid(Rslt, 17, 4)<br />
&nbsp; &nbsp; StateFIP = Mid(Rslt, 21, 2)<br />
&nbsp; &nbsp; County = Mid(Rslt, 23, 4)<br />
&nbsp; &nbsp; Urban = Mid(Rslt, 27, 1)<br />
&nbsp; &nbsp; City = Mid(Rslt, 28, 4)<br />
&nbsp; &nbsp; CityPop = Mid(Rslt, 32, 5)<br />
&nbsp; &nbsp; UrbPop = Mid(Rslt, 37, 5)<br />
&nbsp; &nbsp; OwnerShip = Mid(Rslt, 42, 2)<br />
&nbsp; &nbsp; MorgTotal = Mid(Rslt, 44, 4)<br />
&nbsp; &nbsp; MorgAmt1 = Mid(Rslt, 48, 5)<br />
&nbsp; &nbsp; RentGross = Mid(Rslt, 53, 4)<br />
&nbsp; &nbsp; HHIncome = Mid(Rslt, 57, 7)<br />
&nbsp; &nbsp; PerNum = Mid(Rslt, 64, 4)<br />
&nbsp; &nbsp; PerWt = Mid(Rslt, 68, 4)<br />
&nbsp; &nbsp; Age = Mid(Rslt, 72, 3)<br />
&nbsp; &nbsp; Sex = Mid(Rslt, 75, 1)<br />
&nbsp; &nbsp; MarSt = Mid(Rslt, 76, 1)<br />
&nbsp; &nbsp; Race = Mid(Rslt, 77, 3)<br />
&nbsp; &nbsp; GradeAtt = Mid(Rslt, 80, 2)<br />
&nbsp; &nbsp; Occ1950 = Mid(Rslt, 82, 3)<br />
&nbsp; &nbsp; Ind1950 = Mid(Rslt, 85, 3)<br />
&nbsp; &nbsp; IncTot = Mid(Rslt, 88, 7)<br />
&nbsp; &nbsp; FamTotInc = Mid(Rslt, 95, 7)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> 0<br />
&nbsp; &nbsp; Write #OutF, Yr, DataNum, Serial, NumPrec, HHwt, StateFIP, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; County, Urban, City, CityPop, UrbPop, OwnerShip, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; MorgTotal, MorgAmt1, RentGross, HHIncome, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; PerNum, PerWt, Age, Sex, MarSt, Race, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; GradeAtt, Occ1950, Ind1950, IncTot, FamTotInc<br />
<br />
&nbsp; &nbsp; <span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span><br />
<span style="color: #000080;">Sub</span> openDB9()<br />
&nbsp; &nbsp; <span style="color: #000080;">Dim</span> X, Rslt <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>, OutF <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span><br />
&nbsp; &nbsp; X = FreeFile()<br />
&nbsp; &nbsp; <span style="color: #000080;">Open</span> <span style="color: #800000;">&quot;c:\tushar\work\usa_00009.dat\usa_00009.dat&quot;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">For</span> <span style="color: #000080;">Binary</span> <span style="color: #000080;">As</span> #X Len = 102<br />
&nbsp; &nbsp; OutF = FreeFile()<br />
&nbsp; &nbsp; <span style="color: #000080;">Open</span> <span style="color: #800000;">&quot;c:\tushar\work\usa_00009.txt&quot;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">For</span> <span style="color: #000080;">Output</span> <span style="color: #000080;">As</span> #OutF<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; Write #OutF, <span style="color: #800000;">&quot;Yr&quot;</span>, <span style="color: #800000;">&quot;DataNum&quot;</span>, <span style="color: #800000;">&quot;Serial&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;NumPrec&quot;</span>, <span style="color: #800000;">&quot;HHwt&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;StateFIP&quot;</span>, <span style="color: #800000;">&quot;County&quot;</span>, <span style="color: #800000;">&quot;Urban&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;City&quot;</span>, <span style="color: #800000;">&quot;CityPop&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;UrbPop&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;OwnerShip&quot;</span>, <span style="color: #800000;">&quot;MorgTotal&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;MorgAmt1&quot;</span>, <span style="color: #800000;">&quot;RentGross&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;HHIncome&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;PerNum&quot;</span>, <span style="color: #800000;">&quot;PerWt&quot;</span>, <span style="color: #800000;">&quot;Age&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;Sex&quot;</span>, <span style="color: #800000;">&quot;MarSt&quot;</span>, <span style="color: #800000;">&quot;Race&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;GradeAtt&quot;</span>, <span style="color: #800000;">&quot;Occ1950&quot;</span>, <span style="color: #800000;">&quot;Ind1950&quot;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800000;">&quot;IncTot&quot;</span>, <span style="color: #800000;">&quot;FamTotInc&quot;</span><br />
&nbsp; &nbsp; Rslt = <span style="color: #000080;">String</span>(102, <span style="color: #800000;">&quot; &quot;</span>)<br />
&nbsp; &nbsp; <span style="color: #000080;">Get</span> #X, , Rslt<br />
&nbsp; &nbsp; <span style="color: #000080;">Do</span> <span style="color: #000080;">While</span> <span style="color: #000080;">Not</span> EOF(X)<br />
&nbsp; &nbsp; &nbsp; &nbsp; writeOneRec OutF, Rslt<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">Get</span> #X, , Rslt<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">Loop</span><br />
&nbsp; &nbsp; <span style="color: #008000;">'Stop<br />
</span> &nbsp; &nbsp;<span style="color: #000080;">Close</span> #X: <span style="color: #000080;">Close</span> #OutF<br />
&nbsp; &nbsp; <span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></div></div>
<p>And, so now, I have a CSV data set ready to load into PowerPivot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/02/27/powerpivot-part-2-of-4-prepping-the-census-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PowerPivot - Part 1 of 4</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/</link>
		<comments>http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 03:33:07 +0000</pubDate>
		<dc:creator>Tushar Mehta</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3589</guid>
		<description><![CDATA[After the MVP Summit I was motivated to further explore a Microsoft add-in for Excel 2010 called PowerPivot.  I don&#8217;t know all its capabilities but at the very least it can analyze millions of rows of data.  If you are using Excel 2010 you can download the add-in from http://www.microsoft.com/downloads/details.aspx?FamilyID=48a5b47b-8c9c-450f-ab6e-178600a733ca&#038;displaylang=en
Do keep one thing [...]]]></description>
			<content:encoded><![CDATA[<p>After the MVP Summit I was motivated to further explore a Microsoft add-in for Excel 2010 called PowerPivot.  I don&#8217;t know all its capabilities but at the very least it can analyze <strong>millions </strong>of rows of data.  If you are using Excel 2010 you can download the add-in from <a target="new" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=48a5b47b-8c9c-450f-ab6e-178600a733ca&#038;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=48a5b47b-8c9c-450f-ab6e-178600a733ca&#038;displaylang=en</a></p>
<p>Do keep one thing in mind.  The Community Technical Preview (CTP) version of the PowerPivot addin that is currently available is incompatible with the currently available version of Office 2010, i.e., the Release Candidate (RC).  The problem seems to lie in that the data in the PowerPivot tables are not stored in the Excel file as they should be.  So, on reopening the file, there is no database for PP to use!  I assume (hope?) Microsoft will fix this incompatibility soon.</p>
<p>A day after returning from the Summit, I ran into a contest organized by Microsoft on creative uses of PowerPivot.  I scrambled to put together an entry since the contest closed in 2 days.  First, I had to install PowerPivot.  Then, I decided to use census data as the source for some kind of analysis.  It took me quite a while to figure out how to get that data.  Then, I analyzed the data set with PP.  Finally, I decided to marry the &#8220;%change in population from one census to the next&#8221; with a solution I had posted on my web site to conditionally color shapes in an Excel worksheet (<a target="new"  href="http://www.tushar-mehta.com/excel/charts/0301-dashboard-conditional%20shape%20colors.htm">http://www.tushar-mehta.com/excel/charts/0301-dashboard-conditional%20shape%20colors.htm</a>).</p>
<p>I will post more detailed reports on my experience with PP and the census data.  Part 2 will be about my experience getting the census data.  Part 3 will be about the add-in to conditionally color shapes, and Part 4 will be about using PP in a relatively basic manner while integrating the result with the add-in.</p>
<p>For now, here is an image representing the result. </p>
<p><img src="http://www.dailydoseofexcel.com/blogpix/powerpivot.png" alt="powerpivot" title="powerpivot" width="725" height="854" class="aligncenter size-full wp-image-3591" /></p>
<p>For those curious about the contest (now closed), here is a link: <a target="new" href="http://wildfireapp.com/website/6/contests/19877/voteable_entries/3165298">http://wildfireapp.com/website/6/contests/19877/voteable_entries/3165298</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dailydoseofexcel.com/archives/2010/02/26/powerpivot-part-1-of-4/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
