<?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>Yarrcade.com &#187; MS Office</title>
	<atom:link href="http://www.yarrcade.com/category/msoffice/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yarrcade.com</link>
	<description>A heavy metal pirate&#039;s blog about free online flash games and their monetization as well as game design and development tutorials with actionscript3 and flash cs3 and some tricks to outperform in Microsoft Office ...</description>
	<lastBuildDate>Thu, 15 Sep 2011 15:05:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Excel: Preparing/Categorizing data for contour plots, surface plots and 3D histograms</title>
		<link>http://www.yarrcade.com/2011/08/25/excel-preparingcategorizing-data-for-contour-plots-surface-plots-and-3d-histogram/</link>
		<comments>http://www.yarrcade.com/2011/08/25/excel-preparingcategorizing-data-for-contour-plots-surface-plots-and-3d-histogram/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 02:50:24 +0000</pubDate>
		<dc:creator>kegogrog</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[MS Office]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[surface plot]]></category>

		<guid isPermaLink="false">http://www.yarrcade.com/?p=1710</guid>
		<description><![CDATA[Coming in with a lot of (continuous numerical) data, I struggled to find a neat chart type to display it. I went for a contour plot but it needs the data sorted in rows and columns while my data consisted &#8230; <a href="http://www.yarrcade.com/2011/08/25/excel-preparingcategorizing-data-for-contour-plots-surface-plots-and-3d-histogram/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="contentthumb"><img src="http://www.yarrcade.com/wp-content/uploads/2011/08/thumb_100x100_srfc.png" alt="surface data thumb" width="100" height="100" align="right" hspace="5"></div>
<p>Coming in with a lot of (continuous numerical) data, I struggled to find a neat chart type to display it. I went for a contour plot but it needs the data sorted in rows and columns while my data consisted of 5000 rows and two columns. Manual ordering would have been possible but to work intensive (5000 rows!). And since <code>COUNTIF</code> does not come with the ability two compare two criteria (or I just did not find it) I figured out a pretty good workaround. By the way, this works in Excel2007 but should work in 2003 and 2010 too.<br />
<span id="more-1710"></span><br />
Let&#8217;s assume I have got the data for a process (like a flow and a temperature) and I would like to see where the main operating point of a piece of equipment is. This requires three dimensions and is best shown in a <a href="http://en.wikipedia.org/wiki/Contour_line">countour plot</a> (<i>fig. a</i>).<br />
<div id="attachment_1712" class="wp-caption aligncenter" style="width: 413px"><img src="http://www.yarrcade.com/wp-content/uploads/2011/08/contourplot.png" alt="contour plot" title="contour plot" width="403" height="300" class="size-full wp-image-1712" /><p class="wp-caption-text">Fig. a) The contour plot</p></div></p>
<p>The data structure we need can be seen <a href="http://office.microsoft.com/en-us/excel-help/creating-a-surface-chart-HA001117939.aspx">here</a>. In the case of TL;DR we need columns for x values (or x value categories in the case of continuous numerical data) and rows for the y values (or categories). What I needed was the number of value pairs (x and y) fitting into each of the category pairs. But before that:</p>
<h3>Setting up the data grid</h3>
<p><i>An example spreadsheed follows at the end of this article, feel free to peek into it to follow my explanations.</i><br />
Since we want to sort values (value pairs) we need some categories they fit in. To set up a category grid I first retrieved the following variables:</p>
<dt>x value range</dt>
<dd>the minimal and maximal value in x</dd>
<dt>y value range</dt>
<dd>the minimal and maximal value in y</dd>
<dt>x span</dt>
<dd>the actual difference between the max and min x values</dd>
<dt>y span</dt>
<dd>same as above for y</dd>
<dt>grid size</dt>
<dd>the number of categories for x and y, the higher this number the finer the grid (do twice for a non square grid)</dd>
<dt>x step</dt>
<dd>the range between the lower and upper bound of one category, determined by x span and grid size</dd>
<dt>y step</dt>
<dd>see x step</dd>
<p>The value ranges can be retrieved by the functions <code>MIN</code> and <code>MAX</code>. To have even values as categories, it is proven useful to nest those into<code>FLOOR</code> respectively <code>CEILING</code>. Caveat: <code>FLOOR</code> and <code>CEILING</code> in excel do round AWAY from zero and need a significance related to the actual value.<br />
So, if you&#8217;d like to <code>FLOOR</code> all values (away from zero) and you&#8217;ve got positive and negative numbers you could write <code>=FLOOR(yourCell,IF(yourCell>=0, 1,-1))</code>.<br />
If you&#8217;d rather like to have a floor rounding like in ActionsScript you would need to write <code>=IF(yourCell<0, CEILING(yourCell, -1), FLOOR(yourCell,1))</code> or the other way around for the 'real' ceiling rounding.</p>
<p>I recommend the second if you need categories in the negative to get the best bounds. The significance also has potential to influence the display of the data, so choose that depending on what you got or looks best.</p>
<p>The span just is the difference between min and max range value. I will not post the formula for this one. If you can't figure that out, you probably should not use excel or look it up in the attached example spreadsheet.</p>
<p>The step size is the quotient of span by grid size.</p>
<h3>Categorization</h3>
<p>Now that we have that, we set up three more columns:</p>
<dt>x category</dt>
<dd>the category, that the actual x value is in</dd>
<dt>y category</dt>
<dd>the category, that the actual y value is in</dd>
<dt>category</dt>
<dd>the final name of the category for the value pair, used for the <code>COUNTIF</code> function as a single criterion</dd>
<p>The x and y category column hold the quotients of the actual value by step size. Using <code>FLOOR</code> returns the value by means of <i>greater than or equal to</i> the lower bound and <i>less than</i> the upper bound.</p>
<p>The core piece of this workaround is the category column. With <code>=CONCATENATE(x category cell, "-", y category cell)</code> a hybrid label is created, in that case it returns something like "1-3" or "4-2" which is exactly one of the combinations we later look for with <code>COUNTIF</code>. If your gird size is equal to or exceeds 10 you may need to add leading zeros by <code>=CONCATENATE(IF(I3<10, "0", ""), I3, "-", IF(J3<10, "0", ""), J3)</code>. The returned values the look like "01-10" or "04-04". But that is more of an aesthetical thing.</p>
<h3>The grid data and the chart</h3>
<p>Now that's pretty simple again. Set up a table with x categories as the column headers and y categories as row headers. Enter <code>=COUNTIF(category column, CONCATENATE(IF(x catgory<10,"0",""),x category,"-",IF(y category<10,"0",""),y category))</code>. What it does is computing the category name (the combination) on the fly and counting how many labels in the category column it equals.</p>
<div id="attachment_1713" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.yarrcade.com/wp-content/uploads/2011/08/dataview.png"><img src="http://www.yarrcade.com/wp-content/uploads/2011/08/dataview-1024x518.png" alt="The surface.xlsx spreadsheet" title="The surface.xlsx spreadsheet" width="640" height="323" class="size-large wp-image-1713" /></a><p class="wp-caption-text">The surface.xlsx spreadsheet</p></div>
<p>Then just mark the cells (insert some row and column headings to use in the chart if you like first) and insert a surface chart or contour plot.</p>
<div id="attachment_1715" class="wp-caption aligncenter" style="width: 432px"><a href="http://www.yarrcade.com/wp-content/uploads/2011/08/surfaceplot.png"><img src="http://www.yarrcade.com/wp-content/uploads/2011/08/surfaceplot.png" alt="surface plot" title="surface plot" width="422" height="300" class="size-full wp-image-1715" /></a><p class="wp-caption-text">surface plot</p></div>
<p>Something I tested also, was a 3D column chart as a 3D histogram.</p>
<div id="attachment_1714" class="wp-caption aligncenter" style="width: 383px"><a href="http://www.yarrcade.com/wp-content/uploads/2011/08/histogram.png"><img src="http://www.yarrcade.com/wp-content/uploads/2011/08/histogram.png" alt="histogram" title="histogram" width="373" height="300" class="size-full wp-image-1714" /></a><p class="wp-caption-text">histogram</p></div>
<p>It might sound difficult at first but feel free to play with the example and make some nice charts. If there are questions just post a comment.<br />
Source: <a href='http://www.yarrcade.com/wp-content/uploads/2011/08/SurfaceData.xlsx'>SurfaceData.xlsx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yarrcade.com/2011/08/25/excel-preparingcategorizing-data-for-contour-plots-surface-plots-and-3d-histogram/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel/VisualBasic: Turning daily textfiles into monthly spreadsheets</title>
		<link>http://www.yarrcade.com/2010/04/29/excel-visual-basi-turning-daily-textfiles-into-monthly-spreadsheets/</link>
		<comments>http://www.yarrcade.com/2010/04/29/excel-visual-basi-turning-daily-textfiles-into-monthly-spreadsheets/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 01:55:21 +0000</pubDate>
		<dc:creator>kegogrog</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[MS Office]]></category>
		<category><![CDATA[import text file]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[opentext]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://www.yarrcade.com/?p=1092</guid>
		<description><![CDATA[The task was to use text files that are created by an external program on a daily basis to create a workbook that contains those files&#8217; data in monthly spreadsheets. The good thing is, the text files were named &#8216;DATAYYMMDD&#8217;, &#8230; <a href="http://www.yarrcade.com/2010/04/29/excel-visual-basi-turning-daily-textfiles-into-monthly-spreadsheets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The task was to use text files that are created by an external program on a daily basis to create a workbook that contains those files&#8217; data in monthly spreadsheets. The good thing is, the text files were named &#8216;DATAYYMMDD&#8217;, so there is a keyword (&#8220;DATA&#8221;) and the actual date in year, month and day form.<br />
<span id="more-1092"></span><br />
Let&#8217;s go! To create a new macro you simply select &#8216;Tools&#8217;&rarr;&#8217;Macro&#8217;&rarr;&#8217;Macros&#8217; or hit Alt+F8 to get the list of macros that acually exist. By typing in a macro name (&#8220;myMacroName&#8221; for now), the &#8216;Create&#8217; option becomes available. Hit it. Now we are presented with something like</p>
<pre lang="visualBasic">
Sub myMacroName()

End Sub
</pre>
<p>Now that&#8217;s clean. To see what parameters a function needs I often use &#8216;Tools&#8217;&rarr;&#8217;Macro&#8217;&rarr;&#8217;Record new Macro&#8217;. When done I have a look at the automatically created code and adjust it the way I need it. I would strongly recommend that to find what parameters the import function will need.</p>
<p>Alright, first thing that we do, is creating a string of a given date. I need three <i>count</i> variables that hold the actual numbers and thus can do some math. While turning them into strings I check if they comply with the YYMMDD format. So, if a number is less than 10 I add add &#8220;0&#8243; to the string to get strings like &#8220;090909&#8243; instead of &#8220;999&#8243; for September 9, 2009. This string is presented in <i>actualDate</i>.</p>
<pre lang="visualBasic">
Sub myMacroName()

yearCount = 9
monthCount = 1
dayCount = 1

If yearCount <= 9 Then
    yearString = "0" &#038; yearCount
Else
    yearString = yearCount
End If

If monthCount <= 9 Then
    monthString = "0" &#038; monthCount
Else
    monthString = monthCount
End If

If dayCount <= 9 Then
    dayString = "0" &#038; dayCount
Else
    dayString = dayCount
End If

actualDate = yearString &#038; monthString &#038; dayString

End Sub
</pre>
<p>Ok, so far so good. To transfer that data we need a new sheet in our workbook. That is easily created and with our strings the name is set fast. And we need an end date so the macro won't loop forever.</p>
<pre lang="visualbasic">
Sheets.Add
ActiveSheet.Name = yearString &#038; monthString

endDate = "100428"
</pre>
<p>Next thing to do is setting up the loop. We'll go with a simple <i>While Wend</i> here just by checking if <i>actualDate</i> is not equal to our <i>endDate</i></p>
<pre lang="visualbasic">
While actualDate <> endDate

pathName = "C:\complete\path\here\to\datafolder\"
fileNameString = "DATA" &#038; yearString &#038; monthString &#038; dayString &#038; ".TXT"
nameString = "DATA" &#038; yearString &#038; monthString &#038; dayString
compString = pathName &#038; fileNameString
</pre>
<p>In <i>pathName</i> the complete folder structure is given to access the text files. It is included in the loop here though it is not neccessary but maybe you have got data that is already in folders that are created with the date. <i>fileNameString</i> is the complete file name. So, for September 9, 2009 we would get "DATA090909.TXT". Don't forget the extension. <i>nameString</i> is the file name without extension and thus the name of the spreadsheet that the imported text file will create. <i>compString</i> is the complete path including the file name. We will need that to open the file. We'll do that now and we'll do it straightforward.</p>
<pre lang="visualbasic">
If Len(Dir(compString)) > 0 Then
    Workbooks.OpenText Filename:=compString _
    , Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
    Array(Array(0, 1), Array(5, 1), Array(17, 1), Array(26, 2), Array(41, 1), Array(45, 1), _
    Array(53, 1), Array(132, 1)), TrailingMinusNumbers:=True
    Windows(fileNameString).Activate
    Sheets(nameString).Select
    Sheets(nameString).Move After:=Workbooks("myWorkBook.xls").Sheets(1)
    Range("A2").Select
    If ActiveCell.Value <> "" Then
    Range("A1").Select
        Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
        Selection.Cut
        Sheets(yearString &#038; monthString).Select
        ActiveSheet.Paste
        Selection.End(xlDown).Select
        ActiveCell.Offset(1, 0).Select
    End If
    Sheets(nameString).Select
    ActiveWindow.SelectedSheets.Delete
End If
</pre>
<p>Woof! Ok, the first line checks if there is a file with that name in that path. Cool, eh? With <i>OpenText</i> the text file is imported (surprise!) and that is done involving all the parameters I told you to get experimentally before. That sheet is then moved to the workbook ("myWorkBook.xls"). Then I check if there is a value on the second row. Not the best choice if there were days with only one entry but you can fit that to your needs. If the second cell has a value, the whole area containing values is cut and transferred to the relevant monthly spreadsheet. Afterwards, the imported daily sheet is deleted. One addition on this: In order to get around confirming every deletion we set <i>Application.DisplayAlerts = False</i> on the first line of that macro and <i>True</i> on the last line.</p>
<p>That's nearly it. Now we need the next day, if it is the last of the month it's day one of the next month and after some turns we will need to set it day one of month one of the next year. Every time a new month begins a new sheet needs to be created, so a little boolean will tell the macro when and when not.<br />
While setting the new values these are transformed into strings like in the beginning of the macro. Oh, and the actual date is created from the new strings before finishing the loop with <i>Wend</i>.</p>
<pre lang="visualbasic">
dayCount = dayCount + 1
newSheetBool = False
If dayCount > 31 Then
    dayCount = 1
    monthCount = monthCount + 1
    newSheetBool = True
    If monthCount > 12 Then
        monthCount = 1
        yearCount = yearCount + 1
        newSheetBool = True
    End If
End If

If dayCount <= 9 Then
    dayString = "0" &#038; dayCount
Else
    dayString = dayCount
End If

If monthCount <= 9 Then
    monthString = "0" &#038; monthCount
Else
    monthString = monthCount
End If

If yearCount <= 9 Then
    yearString = "0" &#038; yearCount
Else
    yearString = yearCount
End If

If newSheetBool = True Then
    Sheets.Add
    ActiveSheet.Name = yearString &#038; monthString
End If

actualDate = yearString &#038; monthString &#038; dayString

Wend
</pre>
<p>Fantastic. The box below holds the complete code. Leave a comment if that helped in any way.</p>
<pre lang="visualbasic" colla="-">
Sub gather()

Application.DisplayAlerts = False

Range("A1").Select

yearCount = 9
monthCount = 1
dayCount = 1

If yearCount <= 9 Then
    yearString = "0" &#038; yearCount
Else
    yearString = yearCount
End If

If monthCount <= 9 Then
    monthString = "0" &#038; monthCount
Else
    monthString = monthCount
End If

If dayCount <= 9 Then
    dayString = "0" &#038; dayCount
Else
    dayString = dayCount
End If

Sheets.Add
ActiveSheet.Name = yearString &#038; monthString

endDate = "100428"

actualDate = yearString &#038; monthString &#038; dayString

While actualDate <> endDate

pathName = "C:\complete\path\here\to\datafolder\"
fileNameString = "DATA" &#038; yearString &#038; monthString &#038; dayString &#038; ".TXT"
nameString = "DATA" &#038; yearString &#038; monthString &#038; dayString
compString = pathName &#038; fileNameString

If Len(Dir(compString)) > 0 Then
    existsString = "exists"
    Workbooks.OpenText Filename:=compString _
    , Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
    Array(Array(0, 1), Array(5, 1), Array(17, 1), Array(26, 2), Array(41, 1), Array(45, 1), _
    Array(53, 1), Array(132, 1)), TrailingMinusNumbers:=True
    Windows(fileNameString).Activate
    Sheets(nameString).Select
    Sheets(nameString).Move After:=Workbooks("design.xls").Sheets(1)
    Range("A2").Select
'    If ActiveCell.Value = "" Then
'        ActiveCell.Value = "empty" &#038; monthString &#038; "0" &#038; dayString
'        ActiveCell.Offset(1, 0).Select
'        ActiveCell.Value = "empty" &#038; monthString &#038; "0" &#038; dayString
'        Range("A1").Select
'    End If
    If ActiveCell.Value <> "" Then
    Range("A1").Select
        Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
        Selection.Cut
        Sheets(yearString &#038; monthString).Select
        ActiveSheet.Paste
        Selection.End(xlDown).Select
        ActiveCell.Offset(1, 0).Select
    End If
    Sheets(nameString).Select
    ActiveWindow.SelectedSheets.Delete
Else
    existsString = "no file"
End If

dayCount = dayCount + 1
newSheetBool = False
If dayCount > 31 Then
    dayCount = 1
    monthCount = monthCount + 1
    newSheetBool = True
    If monthCount > 12 Then
        monthCount = 1
        yearCount = yearCount + 1
        newSheetBool = True
    End If
End If

If dayCount <= 9 Then
    dayString = "0" &#038; dayCount
Else
    dayString = dayCount
End If

If monthCount <= 9 Then
    monthString = "0" &#038; monthCount
Else
    monthString = monthCount
End If

If yearCount <= 9 Then
    yearString = "0" &#038; yearCount
Else
    yearString = yearCount
End If

If newSheetBool = True Then
    Sheets.Add
    ActiveSheet.Name = yearString &#038; monthString
End If

actualDate = yearString &#038; monthString &#038; dayString

Wend

Application.DisplayAlerts = True

End Sub
</pre>
<p>In ur macros, pillaging ur variabls. Yoho!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yarrcade.com/2010/04/29/excel-visual-basi-turning-daily-textfiles-into-monthly-spreadsheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel: dynamic worksheet names in formulas</title>
		<link>http://www.yarrcade.com/2009/06/16/excel-dynamic-worksheet-names-in-formulas/</link>
		<comments>http://www.yarrcade.com/2009/06/16/excel-dynamic-worksheet-names-in-formulas/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:56:06 +0000</pubDate>
		<dc:creator>kegogrog</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[formula]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[worksheet name]]></category>

		<guid isPermaLink="false">http://www.yarrcade.com/?p=285</guid>
		<description><![CDATA[Let&#8217;s assume, you got 12 worksheets named with year and month. Each sheet contains several values for every day. To put them all together I recommend a combination of the Excel functions CONCATENATE and INDIRECT (the real dynamic duo if &#8230; <a href="http://www.yarrcade.com/2009/06/16/excel-dynamic-worksheet-names-in-formulas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s assume, you got 12 worksheets named with year and month. Each sheet contains several values for every day. To put them all together I recommend a combination of the Excel functions CONCATENATE and INDIRECT (the real dynamic duo if there wasn&#8217;t one before).</p>
<p><span id="more-285"></span><br />
<strong>The training workbook</strong><br />
It consists of three sheets named &#8220;work&#8221;, &#8220;Sheet1&#8243; and &#8220;Sheet2&#8243;. &#8220;Sheet1&#8243; and &#8220;Sheet2&#8243; hold simple data.</p>
<div id="attachment_286" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.natan.info/wp-content/uploads/2009/06/20090617_01.PNG"><img class="size-full wp-image-286" title="20090617_01" src="http://blog.natan.info/wp-content/uploads/2009/06/20090617_01.PNG" alt="The initial training workbook" width="320" height="263" /></a><p class="wp-caption-text">The initial training workbook</p></div>
<p><strong>The INDIRECT function</strong><br />
A cell reference to another sheet contains the sheet&#8217;s name followed by &#8220;!&#8221; (without the quotes) and the cell reference (e.g. B12 for 2nd cloumn and 12th row).<br />
You can get this data by using INDIRECT(ref_text) with a string as ref_text. This string can come from another cell as shown below.</p>
<div id="attachment_287" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.natan.info/wp-content/uploads/2009/06/20090617_02.PNG"><img class="size-full wp-image-287" title="20090617_02" src="http://blog.natan.info/wp-content/uploads/2009/06/20090617_02.PNG" alt="using INDIRECT to get data" width="320" height="263" /></a><p class="wp-caption-text">using INDIRECT to get data</p></div>
<p>As you can see, it&#8217;s the same data as with a direct reference. Well, not that exciting yet.</p>
<p><strong>The CONCATENATE function</strong><br />
This functions adds strings to one longer string. I already used the function in the budget sheet. With CONCATENATE(text1,text2,&#8230;) you can built strings the way you need them.<br />
I renamed &#8220;Sheet1&#8243; and &#8220;Sheet2&#8243; to &#8220;200901&#8243; and &#8220;200902&#8243;. In &#8220;work&#8221; the first column now holds the date. It doesn&#8217;t matter which kind of format, we&#8217;ll extract what we need per function.<br />
The following function is added to cell B2, while A2 holds the date.<br />
<!--start_raw--><code><br />
=INDIRECT(CONCATENATE(YEAR(A2),"0",MONTH(A2),"!B3"))<br />
</code><!--end_raw--><br />
YEAR extracts the year value of A2 (2009), MONTH does so for the month (1), &#8220;0&#8243; and &#8220;!B3&#8243; are neccessary for building and referencing correct. So, CONCATENATE will return 200901!B3 which exactly looks like a direct reference. And in combination with INDIRECT it returns the correct value! With a fast fill down (drag the little square at the bottom right down over as many cell as you want to be filled with the formula) it does so for the third row!</p>
<div id="attachment_288" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.natan.info/wp-content/uploads/2009/06/20090617_03.PNG"><img class="size-full wp-image-288" title="20090617_03" src="http://blog.natan.info/wp-content/uploads/2009/06/20090617_03.PNG" alt="The working worksheet" width="320" height="263" /></a><p class="wp-caption-text">The working worksheet</p></div>
<p>While there is no sheet for March the cell returns a #REF, as it does for the direct link (manually put in =200903!B3 because there&#8217;s no sheet to click in).</p>
<p><strong>The power of dynamic references</strong><br />
Once I insert a worksheet and rename it to &#8220;200903&#8243; the indirect reference gives back a value while the direct link still doesn&#8217;t work. Select this cell, enter the formula bar (clicking or F2) and hit &#8216;enter&#8217;, then the direct link is some kind of reevaluated.</p>
<div id="attachment_290" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.natan.info/wp-content/uploads/2009/06/20090617_04.PNG"><img class="size-full wp-image-290" title="20090617_04" src="http://blog.natan.info/wp-content/uploads/2009/06/20090617_04.PNG" alt="dynamic reference" width="320" height="263" /></a><p class="wp-caption-text">dynamic reference</p></div>
<p>The other way round, deleting &#8220;200903&#8243; completely destroys our reference there. The INDIRECT thing will work again once a sheet &#8220;200903&#8243; is inserted again, the direct one won&#8217;t.</p>
<div id="attachment_289" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.natan.info/wp-content/uploads/2009/06/20090617_05.PNG"><img class="size-full wp-image-289" title="20090617_05" src="http://blog.natan.info/wp-content/uploads/2009/06/20090617_05.PNG" alt="Uhh, devastation in references..." width="320" height="263" /></a><p class="wp-caption-text">Uhh, devastation in references...</p></div>
<p>To conclude: you can use the indirect for complex formulas as well. If the formula was<br />
<!--start_raw--><code>=SUM(INDIRECT(CONCATENATE(YEAR(A2),"0",MONTH(A2),"!","B:B")))<br />
</code><!--end_raw--><br />
it sums up every value in column B on the referenced worksheet.</p>
<div id="attachment_291" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.natan.info/wp-content/uploads/2009/06/20090617_06.PNG"><img class="size-full wp-image-291" title="20090617_06" src="http://blog.natan.info/wp-content/uploads/2009/06/20090617_06.PNG" alt="The summary." width="320" height="263" /></a><p class="wp-caption-text">The summary.</p></div>
<p>That works for everything you most likely need, e.g. COUNTIF, COUNTA, SUMIF&#8230; . If there are open questions just let me know.</p>
<p>That&#8217;s t&#8217; power o&#8217; t&#8217; shooting below t&#8217; waterline. Yo ho!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yarrcade.com/2009/06/16/excel-dynamic-worksheet-names-in-formulas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Outlook: Deleting old calendar items the fast way</title>
		<link>http://www.yarrcade.com/2009/06/15/outlook-deleting-old-calendar-items-the-fast-way/</link>
		<comments>http://www.yarrcade.com/2009/06/15/outlook-deleting-old-calendar-items-the-fast-way/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 19:45:09 +0000</pubDate>
		<dc:creator>kegogrog</dc:creator>
				<category><![CDATA[Outlook]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[old items]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.yarrcade.com/?p=283</guid>
		<description><![CDATA[Getting rid of old calendar items that waste storage capacity is easy. Just open the calendar and change &#8216;View -> Arrange by -> Current View&#8217; to &#8216;by Category&#8217;. Now you got your items listed. Make sure &#8216;View -> Arrange by &#8230; <a href="http://www.yarrcade.com/2009/06/15/outlook-deleting-old-calendar-items-the-fast-way/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Getting rid of old calendar items that waste storage capacity is easy.<br />
<span id="more-283"></span><br />
Just open the calendar and change &#8216;View -> Arrange by -> Current View&#8217; to &#8216;by Category&#8217;. Now you got your items listed. Make sure &#8216;View -> Arrange by -> Show in Groups&#8217; is deactivated. Sort the list ascending by end date. Now you can mark all items by click and either pressing Shift (for all items between the selected two) or Strg (for all clicked items only).<br />
One &#8216;Del&#8217; does the job.</p>
<p>There ye be wit&#8217; a clean calendar deck. Yo ho!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yarrcade.com/2009/06/15/outlook-deleting-old-calendar-items-the-fast-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel: Creating a budget sheet</title>
		<link>http://www.yarrcade.com/2009/06/05/excel-creating-a-budget-sheet/</link>
		<comments>http://www.yarrcade.com/2009/06/05/excel-creating-a-budget-sheet/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 02:59:51 +0000</pubDate>
		<dc:creator>kegogrog</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[accounting]]></category>
		<category><![CDATA[budget]]></category>
		<category><![CDATA[concatenate]]></category>
		<category><![CDATA[finance]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.yarrcade.com/?p=155</guid>
		<description><![CDATA[Setting up a workbook Open Excel and create a blank workbook. The default settings will create three Worksheets, that&#8217;s enough. My personal settings only create one sheet, the others are inserted by &#8216;Insert->Worksheet&#8217;. For the beginning we need two sheets. &#8230; <a href="http://www.yarrcade.com/2009/06/05/excel-creating-a-budget-sheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Setting up a workbook</strong><br />
Open Excel and create a blank workbook. The default settings will create three Worksheets, that&#8217;s enough. My personal settings only create one sheet, the others are inserted by &#8216;Insert->Worksheet&#8217;. For the beginning we need two sheets. These are renamed (rightclick on tab->Rename) to &#8216;budget&#8217; and (for actual reasons) &#8217;2009&#8242;. Then go to &#8216;File->Save as&#8230;&#8217; and save it.<br />
<span id="more-155"></span></p>
<div id="attachment_157" class="wp-caption alignnone" style="width: 324px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget1.png" alt="renaming the tabs" title="excelbudget1" width="314" height="91" class="size-full wp-image-157" /><p class="wp-caption-text">renaming the tabs</p></div>
<p><strong>Setting up the budget sheet</strong><br />
This first tutorial covers a rather simple approach, with month, account, several incomes and expenditures. I have chosen some examples for now.</p>
<div id="attachment_158" class="wp-caption alignnone" style="width: 241px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget2.png" alt="setting up the budget sheet" title="excelbudget2" width="231" height="195" class="size-full wp-image-158" /><p class="wp-caption-text">setting up the budget sheet</p></div>
<p>Just put Jan-2009 into C9, select C9 per simple click, grab the little lower-right-corner-square and drag it vertically to get the months filled in automatically.</p>
<div id="attachment_159" class="wp-caption alignnone" style="width: 370px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget3.png" alt="autofilling the months" title="excelbudget3" width="360" height="200" class="size-full wp-image-159" /><p class="wp-caption-text">autofilling the months</p></div>
<p><strong>Setting up the input sheet</strong><br />
For obvious reasons, &#8217;2009&#8242; will be our input sheet. Four columns are enough for the moment.</p>
<div id="attachment_160" class="wp-caption alignnone" style="width: 330px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget4.png" alt="setting up the input sheet" title="excelbudget4" width="320" height="200" class="size-full wp-image-160" /><p class="wp-caption-text">setting up the input sheet</p></div>
<p>&#8216;Date&#8217; is when, &#8216;Amount&#8217; is how much and &#8216;Comment&#8217; is your description what for you made the payment/got the money. The &#8216;Class&#8217; will be necessary to get the numbers to the right place. Then there is &#8216;Code&#8217;. This cell is used for transferring payments to the budget sheet.<br />
&#8216;Class&#8217; holds the payment types of the budget sheet. To get it a bit more comfortable, copy all of them to a free column of the input sheet. Then mark column D, &#8216;Data->Validation&#8217;, select &#8216;List&#8217; and fill &#8216;Source&#8217; with the range of your payment types. Click OK, do the same for D1 but this time select &#8216;Any Value&#8217; to have a valid header. Now you can choose the class via drop down, this comes in handy when you handle more payment types.</p>
<div id="attachment_161" class="wp-caption alignnone" style="width: 429px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget5.png" alt="data validation for drop down menus" title="excelbudget5" width="419" height="445" class="size-full wp-image-161" /><p class="wp-caption-text">data validation for drop down menus</p></div>
<p>We&#8217;ll use the concatenate function in &#8216;Code&#8217;:</p>
<p>CONCATENATE(text1, text2,&#8230;) is used to join several text strings into a single string. The formula for E2 is:</p>
<p>=CONCATENATE(MONTH(A2), D2)</p>
<p>This will give us a string containing the number of the month and the payment classification. Some examples:</p>
<div id="attachment_162" class="wp-caption alignnone" style="width: 330px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget6.png" alt="Code examples" title="excelbudget6" width="320" height="200" class="size-full wp-image-162" /><p class="wp-caption-text">Code examples</p></div>
<p><strong>Transferring inputs to the budget</strong><br />
Though it seems a lot of work, calm down, once it is set up, it&#8217;ll work forever. Err, through 2009. On the budget sheet &#8216;Account&#8217;, &#8216;income&#8217; and &#8216;expenditure&#8217; are simple sums (=sum(range)), I think you&#8217;ll get that. The interesting part is transferring the payments to their location. C4 therefore gets the following function:</p>
<p>=SUMIF(&#8217;2009&#8242;!$E:$E,CONCATENATE(MONTH(C$1),$B4),&#8217;2009&#8242;!$B:$B)</p>
<p>SUMIF(range, criteria, sum_range) sums certain cells by given criteria. The range here is the &#8216;Code&#8217; column in the input sheet, for the matching criteria the same concatenate procedure is used with the month row and the class column of the budget sheet. The sum_range obviously is the &#8216;Amount&#8217; column. Be aware of the absolut references<br />
indicated by &#8216;$&#8217;. This enables us to just fill the remaining cells in the budget sheet by dragging. It should instantly show results.</p>
<div id="attachment_163" class="wp-caption alignnone" style="width: 330px"><img src="http://www.natan.info/yarrcade/wp-content/uploads/2009/06/excelbudget7.png" alt="accounting" title="excelbudget7" width="320" height="200" class="size-full wp-image-163" /><p class="wp-caption-text">accounting</p></div>
<p>As this is a basic tutorial there will be no refining today. It just works!</p>
<p>Now count yer bluddy pieces o&#8217; eight. Arrr!
<div align="center">
]]></content:encoded>
			<wfw:commentRss>http://www.yarrcade.com/2009/06/05/excel-creating-a-budget-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel: Automatically adjusted row height of merged cells</title>
		<link>http://www.yarrcade.com/2009/05/28/excel-automatically-adjusted-row-height-of-merged-cells/</link>
		<comments>http://www.yarrcade.com/2009/05/28/excel-automatically-adjusted-row-height-of-merged-cells/#comments</comments>
		<pubDate>Thu, 28 May 2009 17:10:17 +0000</pubDate>
		<dc:creator>kegogrog</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[merged]]></category>
		<category><![CDATA[row]]></category>

		<guid isPermaLink="false">http://www.yarrcade.com/?p=107</guid>
		<description><![CDATA[Within MS Excel one can adjust the height of a row by dragging the boundary below the row heading until the row is the wanted height or double-click the boundary to get an automatically adjusted height that fits the content. &#8230; <a href="http://www.yarrcade.com/2009/05/28/excel-automatically-adjusted-row-height-of-merged-cells/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Within MS Excel one can adjust the height of a row by dragging the boundary below the row heading until the row is the wanted height or double-click the boundary to get an automatically adjusted height that fits the content.</p>
<p>This is true for single column, non-merged cells, whereas the first method also applies to merged cells. But imagine a 300 row sheet. I would not want to drag every row to a certain height after changing the font size. One could say: &#8220;Alright, I&#8217;ll just select the whole sheet by clicking the field left to A and above 1, drag one row to a height that fits the maximum height.&#8221; Lots of empty spaces. Does not look good.</p>
<p>Anyway, in writing the document just add a simple step.<br />
<span id="more-107"></span></p>
<div id="attachment_108" class="wp-caption alignnone" style="width: 489px"><img class="size-full wp-image-108" title="20090528_excel1" src="http://blog.natan.info/wp-content/uploads/2009/05/20090528_excel1.png" alt="wrapped text in merged cell after auto adjusting the height" width="479" height="349" /><p class="wp-caption-text">wrapped text in merged cell after auto adjusting the height</p></div>
<p>In &#8216;Format Cells&#8230; (right click to cell) &#8211; Alignment&#8217; select &#8216;Wrap Text&#8217; while &#8216;Merge cells&#8217; should be already selected.<br />
Then in a <strong>single column cell</strong> enter <strong>manual line breaks</strong> (Alt+Enter while in edit mode). Adapt the number of line breaks to the number of lines in the merged cell, hit Enter and there you are.</p>
<div class="mceTemp">
<div id="attachment_109" class="wp-caption alignnone" style="width: 489px"><img class="size-full wp-image-109" title="20090528_excel2" src="http://blog.natan.info/wp-content/uploads/2009/05/20090528_excel2.png" alt="wrapped text in merged cell after auto adjusting the height with applied manual line break in B14" width="479" height="349" /><p class="wp-caption-text">wrapped text in merged cell after auto adjusting the height with applied manual line break in B14</p></div>
</div>
<p>Dat&#8217;s dat. Yo ho!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yarrcade.com/2009/05/28/excel-automatically-adjusted-row-height-of-merged-cells/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

