<?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>A Developer&#039;s Blog &#187; Office</title>
	<atom:link href="http://blog.hoegaerden.be/category/office/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hoegaerden.be</link>
	<description>SQL Server, BI, .NET, IT and anything else I have been playing with.</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:15:30 +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>A Developer&#8217;s Excel: A Couple Of Tips</title>
		<link>http://blog.hoegaerden.be/2010/06/16/a-developers-excel-a-couple-of-tips/</link>
		<comments>http://blog.hoegaerden.be/2010/06/16/a-developers-excel-a-couple-of-tips/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 15:27:44 +0000</pubDate>
		<dc:creator>Valentino Vranken</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://blog.hoegaerden.be/2010/06/16/a-developers-excel-a-couple-of-tips/</guid>
		<description><![CDATA[As a BI developer I regularly use Excel to analyze my data on correctness.  In Excel it’s easy to filter out unrelated records, as you’ll probably already know. How do I get my data in Excel? With a simple copy/paste.  Since SQL Server 2008, you can just right-click on the results in the Management Studio [...]]]></description>
			<content:encoded><![CDATA[<p>As a BI developer I regularly use Excel to analyze my data on correctness.  In Excel it’s easy to filter out unrelated records, as you’ll probably already know.</p>
<h2>How do I get my data in Excel?</h2>
<p>With a simple copy/paste.  Since SQL Server 2008, you can just right-click on the results in the Management Studio and select <em>Copy with Headers</em>.  This will put the selected data into memory, including the column headers.</p>
<p><img style="display: inline; border-width: 0px;" title="SSMS 2008: right-click on results to Copy with Headers" src="http://blog.hoegaerden.be/wp-content/uploads/image293.png" border="0" alt="SSMS 2008: right-click on results to Copy with Headers" width="449" height="256" /></p>
<p>You can even make a selection in the Results pane and only copy that, as shown in the screenshot above.  Here’s what it looks like when pasted into Excel:</p>
<p><img style="display: inline; border-width: 0px;" title="Data with headers pasted into Excel" src="http://blog.hoegaerden.be/wp-content/uploads/image294.png" border="0" alt="Data with headers pasted into Excel" width="347" height="114" /></p>
<h3>How do I make the columns wider?</h3>
<p>Excel will not expand the column widths by default, shown in that last screenshot.  You could manually enlarge them one by one, but that’s not convenient when you last filled column is called “DI”.  Instead, I use the following trick.  First I select the whole sheet by clicking on the grey square in the top-left corner:</p>
<p><img style="display: inline; border-width: 0px;" title="Select the whole sheet using the grey square" src="http://blog.hoegaerden.be/wp-content/uploads/image295.png" border="0" alt="Select the whole sheet using the grey square" width="360" height="149" /></p>
<p>Then I double-click on the vertical divider in between columns A and B.  This will adjust all column widths so that the data fits nicely.</p>
<p><img style="display: inline; border-width: 0px;" title="Double-click the divider in between two columns to adjust width automatically" src="http://blog.hoegaerden.be/wp-content/uploads/image296.png" border="0" alt="Double-click the divider in between two columns to adjust width automatically" width="626" height="116" /></p>
<h2>Does Excel know SELECT DISTINCT?</h2>
<p>The other day I needed to filter out all duplicate records out of a really large dataset.  I first tried by activating the regular filter.  This is an Excel feature that I use a lot.  Just clicking the <strong>Filter</strong> button on the Data ribbon will add the small dropdowns next to each column’s header:</p>
<p><img style="display: inline; border: 0px;" title="Excel's Filter functionality" src="http://blog.hoegaerden.be/wp-content/uploads/image297.png" border="0" alt="Excel's Filter functionality" width="661" height="289" /></p>
<p>But in those dropdowns I couldn’t find an option which would get me to the required result.</p>
<p>(Note that I added a couple of duplicate records in my dataset.)</p>
<p>After a little search, I found the magic checkbox!  I didn’t know that it could be so easy.</p>
<p>To find it, click the <strong>Advanced</strong> button in the Data ribbon.</p>
<p><img style="display: inline; border-width: 0px;" title="The Advanced button on the Data ribbon" src="http://blog.hoegaerden.be/wp-content/uploads/image298.png" border="0" alt="The Advanced button on the Data ribbon" width="389" height="131" /></p>
<p>In the <strong>Advanced Filter</strong> window that appears you see a checkbox called <em>Unique records only</em>.</p>
<p><img style="display: inline; border: 0px;" title="Advanced Filter: Unique records only checkbox" src="http://blog.hoegaerden.be/wp-content/uploads/image299.png" border="0" alt="Advanced Filter: Unique records only checkbox" width="239" height="242" /></p>
<p>There’s your SELECT DISTINCT!</p>
<p>And here’s the sheet with the duplicates filtered out:</p>
<p><img style="display: inline; border: 0px;" title="Excel sheet after filtering out duplicate records with the &quot;Unique records only&quot; option" src="http://blog.hoegaerden.be/wp-content/uploads/image300.png" border="0" alt="Excel sheet after filtering out duplicate records with the &quot;Unique records only&quot; option" width="659" height="117" /></p>
<p>Do you also see that the filter dropdowns are gone, although I did not remove them?  The Advanced Filter cannot be used in combination with the regular filter.  Once you activate the regular filter by clicking the Filter button, your duplicates will re-appear.</p>
<p>If you want to further filter your data after filtering out all duplicate records, you should select the <em>Copy to another location </em>option in the Advanced Filter window.  Copy it below your data on the same sheet and apply the regular filter on that new set of data.</p>
<p><img style="display: inline; border: 0px;" title="Filtered set of data below full dataset on same sheet" src="http://blog.hoegaerden.be/wp-content/uploads/image301.png" border="0" alt="Filtered set of data below full dataset on same sheet" width="664" height="411" /></p>
<p>Copying to another sheet is not supported.  Apparently you can only copy to the active sheet.  Should you try it out anyway, you’ll get this message:</p>
<p><img style="display: inline; border: 0px;" title="Warning: You can only copy filtered data to the active sheet" src="http://blog.hoegaerden.be/wp-content/uploads/image302.png" border="0" alt="Warning: You can only copy filtered data to the active sheet" width="342" height="121" /></p>
<p>Happy filtering!</p>
<p>Valentino.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.hoegaerden.be%2F2010%2F06%2F16%2Fa-developers-excel-a-couple-of-tips%2F&amp;title=A%20Developer%26rsquo%3Bs%20Excel%3A%20A%20Couple%20Of%20Tips" id="wpa2a_2"><img src="http://blog.hoegaerden.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.hoegaerden.be/2010/06/16/a-developers-excel-a-couple-of-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Excel Auto Fill Feature</title>
		<link>http://blog.hoegaerden.be/2010/02/20/the-excel-auto-fill-feature/</link>
		<comments>http://blog.hoegaerden.be/2010/02/20/the-excel-auto-fill-feature/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 21:29:08 +0000</pubDate>
		<dc:creator>Valentino Vranken</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://blog.hoegaerden.be/2010/02/20/the-excel-auto-fill-feature/</guid>
		<description><![CDATA[A couple of days ago I discovered a very interesting double-click feature in Excel. One that probably already exists for ages &#8211; the oldest version that I was able to try it out on is Excel 2002 and it worked &#8211; but due to being used to other habits I just never found out about [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I discovered a very interesting double-click feature in Excel. One that probably already exists for ages &#8211; the oldest version that I was able to try it out on is Excel 2002 and it worked &#8211; but due to being used to other habits I just never found out about it.&#160; Until now.</p>
<p>When a cell (or a range of cells) is selected, you see a thicker black border around the selection and the bottom-right corner has got a small square attached.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="One cell selected in Excel" border="0" alt="One cell selected in Excel" src="http://blog.hoegaerden.be/wp-content/uploads/image188.png" width="405" height="174" /> </p>
<p>You can drag that squared corner down to get copy-like behaviour. More precisely, when one cell is selected and you drag it down then the value of the selected cell gets copied over into the cells further down, up until the cell where you stop dragging.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The effect of dragging the squared corner with one cell selected" border="0" alt="The effect of dragging the squared corner with one cell selected" src="http://blog.hoegaerden.be/wp-content/uploads/image189.png" width="450" height="155" /> </p>
<p><strong>Note:</strong> the same effect also works horizontally but in real-life circumstances you probably won’t need it much.</p>
<p>When multiple cells are selected and you drag the bottom-right corner down, Excel will apply some logic to continue the series that it possibly detects.</p>
<p>For instance if you have two cells selected with the values 2 and 4, the next cells will get 6, 8, and so on. Or when the first cell contains 2010/10/30 and the second 2010/10/25, the next cells will get date values going down by 5 days per cell.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Excel&#39;s Auto Fill with two rows and two cells per row selected" border="0" alt="Excel&#39;s Auto Fill with two rows and two cells per row selected" src="http://blog.hoegaerden.be/wp-content/uploads/image190.png" width="450" height="272" /> </p>
<p>If you don&#8217;t like the way the series gets applied, there&#8217;s a dropdown poping up at the bottom-right of the new selection at the moment that you stop dragging. In that list you get several different Auto Fill Options, depending on the data type of your selected cells.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The Auto Fill Options" border="0" alt="The Auto Fill Options" src="http://blog.hoegaerden.be/wp-content/uploads/image191.png" width="387" height="483" /> </p>
<p>I&#8217;m sure this is no news to you so far.</p>
<p>But do you know what happens when you just<strong> double-click</strong> that small bottom-right corner instead of dragging it?</p>
<p>I didn&#8217;t, until I just tried it out this past week. The reason that I tried this was because I needed a formula copied down in about 20,000 rows (hey, I&#8217;m a data guy, remember?) and I didn&#8217;t want to waste my time waiting for Excel to scroll down just to the bottom of the list while dragging the corner. So I double-clicked and there came the discovery of the week! It applied the same function as what you get when you drag the corner down, all the way down to the last row of data! Isn&#8217;t that great? From now on I think I&#8217;ll always just double-click instead of drag, much faster!</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The Auto Fill effect after double-clicking the small squared corner (I still wonder what name they&#39;ve given this feature - the Auto Fill Corner possibly?)" border="0" alt="The Auto Fill effect after double-clicking the small squared corner (I still wonder what name they&#39;ve given this feature - the Auto Fill Corner possibly?)" src="http://blog.hoegaerden.be/wp-content/uploads/image192.png" width="609" height="242" /> </p>
<p>And you even get the same popup to select another Fill Option.</p>
<p>Have Fun!</p>
<p>Valentino.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.hoegaerden.be%2F2010%2F02%2F20%2Fthe-excel-auto-fill-feature%2F&amp;title=The%20Excel%20Auto%20Fill%20Feature" id="wpa2a_4"><img src="http://blog.hoegaerden.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.hoegaerden.be/2010/02/20/the-excel-auto-fill-feature/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

