<?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>shhLIFE! &#187; MTG</title>
	<atom:link href="http://jasonschleifer.com/tag/mtg/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasonschleifer.com</link>
	<description>Animation, Rigging, and a whole lotta talkin.</description>
	<lastBuildDate>Sat, 05 Nov 2011 15:53:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
<link>http://jasonschleifer.com</link>
<url>http://jasonschleifer.com/blog/wp-content/mbp-favicon/icon.jpg</url>
<title>shhLIFE!</title>
</image>
		<item>
		<title>Track your Magic The Gathering Collection with OOCalc &#8211; Part III</title>
		<link>http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-iii/</link>
		<comments>http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-iii/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 22:23:38 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[MTG]]></category>
		<category><![CDATA[oocalc]]></category>

		<guid isPermaLink="false">http://jasonschleifer.com/?p=632</guid>
		<description><![CDATA[<p>Now on to part III of my series on using OOCalc to track your Magic The Gathering card collection.  If you&#8217;ve missed parts <a href="http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/">1</a> and <a href="http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-ii/">2</a>, you may want to check them out, since part 3 builds upon those two bits.</p> <p>Seriously, go read <a href="http://jasonschleifer.com/tag/mtg/">them</a>.  You&#8217;ll be missing out on some pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Now on to part III of my series on using OOCalc to track your Magic The Gathering card collection.  If you&#8217;ve missed parts <a href="http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/">1</a> and <a href="http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-ii/">2</a>, you may want to check them out, since part 3 builds upon those two bits.</p>
<p>Seriously, go read <a href="http://jasonschleifer.com/tag/mtg/">them</a>.  You&#8217;ll be missing out on some pretty neato spreadsheet magic.</p>
<p>Go on, it&#8217;s okay.  I&#8217;ll wait.</p>
<p>&#8230;</p>
<p>Okay, you done?  Great!</p>
<p>In part III, we&#8217;re going to create the Collection bit of the spreadsheet where we get the value of our cards and calculate how much our collection is worth!</p>
<p>Oh man, can&#8217;t wait to sell the whole thing and buy a new <a href="http://www.wired.com/gadgetlab/2009/09/apple-tablet-everything/">Apple Tablet</a>.</p>
<p>Yeah, I know they don&#8217;t &#8220;officially&#8221; exist yet, but I&#8217;m allowed to dream, aren&#8217;t I?</p>
<p>Okay, our current spreadsheet has two Sheets.. a blank Collection sheet, and our Pricelist that we downloaded and imported in part 2.</p>
<p>The Collection sheet is going to have the following columns: <strong>Card Name</strong>, <strong>Count</strong>, and <strong>Value</strong>. These should be pretty self explanatory, but just to make sure everyone is on the same page here..</p>
<p><strong>Card Name</strong> will be the name of the card I want the value of.  It should match one of the names from the Pricelist sheet.</p>
<p><strong>Count</strong> is the number of these cards that I have.</p>
<p><strong>Value</strong> is going to be the associated price of the <strong>Card Name</strong> from the Pricelist sheet, multiplied by the <strong>Count</strong>.</p>
<p>So far so good?  Great!  Here&#8217;s an image of my spreadsheet so far with those headings placed at <strong>A1</strong>, <strong>B1</strong>, and <strong>C1</strong>.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection1.png"><img class="aligncenter size-full wp-image-635" title="collection1" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection1.png" alt="collection1" width="350" height="171" /></a></p>
<p>Let&#8217;s go ahead and just enter the name of a card in <strong>A2</strong>.  For the fun of it, let&#8217;s pick a card that&#8217;s worth quite a bit of money.  How about.. <strong>Ancestral Recall</strong> from the <strong>Alpha</strong> series of cards.</p>
<p>Select <strong>A2</strong> and type:</p>
<p><strong>Ancestral Recall (A)</strong></p>
<p>Obviously nothing happens yet, because we haven&#8217;t told <strong>C2</strong> to get the price.  We&#8217;ll use the <strong>VLOOKUP</strong> function here to make the query.</p>
<p>Select <strong>C2</strong> and type:</p>
<p><strong>=VLOOKUP(A2;Pricelist.A2:B14317;2;1)</strong></p>
<p><strong><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection2.png"><img class="aligncenter size-full wp-image-636" title="collection2" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection2.png" alt="collection2" width="496" height="91" /></a><br />
</strong></p>
<p>Remember.. the first field is the cell we want to grab and the second field is the array we&#8217;re going to search.  The third is the column within that array that we&#8217;re going to return, and the fourth is whether or not we&#8217;re sorting.  Since our pricelist is sorted alphabetially, we&#8217;re going to enter &#8220;1&#8243; for the sort value.</p>
<p>Notice something special in the second field.. we&#8217;re specifying a <em>specific</em> sheet to search for the array: <strong>Pricelist.A2:B14317</strong>.  This tells oocalc to go to a <em>different</em> sheet than the one we&#8217;re currently on.  If we didn&#8217;t do this, we would be searching the current sheet, and that wouldn&#8217;t do us any good at all.</p>
<p>We&#8217;re not quite finished yet, we still need to enter a <strong>Count</strong>.  Let&#8217;s pretend that we actually were really lucky and found 4 of these Ancestral Recall (A) cards.  Go ahead and enter 4 in <strong>B2</strong>.</p>
<p>Notice the value didn&#8217;t update, so we need to update the <strong>VLOOKUP</strong> function to multiply the value by the count.  Change <strong>VLOOKUP</strong> to:</p>
<p><strong>=VLOOKUP(A2;Pricelist.A2:B14317;2;1) * B2</strong></p>
<p><strong><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection3.png"><img class="aligncenter size-full wp-image-637" title="collection3" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection3.png" alt="collection3" width="529" height="97" /></a></strong></p>
<p>Not bad!  However, we still need to make a few more adjustments.  First, remember in part 1 when we copied and pasted our function it would offset the search values?  That&#8217;ll happen again if we copy <strong>C2</strong> to <strong>C3</strong>.  Give it a shot and see what you get:</p>
<p>C2:<strong> =VLOOKUP(A2;Pricelist.A2:B14317;2;1) * B2</strong></p>
<p>C3:<strong> =VLOOKUP(A3;Pricelist.A3:B14318;2;1) * B3</strong></p>
<p>Some of the offsetting is fine.. A2 to A3 and B2 to B3 for example.  But the <strong>Pricelist.A2:B14317</strong> being changed to <strong>Pricelist.A3:B14318</strong> isn&#8217;t going to work.  Again, we need to use the <strong>$</strong> symbol to lock down the cells we don&#8217;t want to adjust.</p>
<p>Change <strong>C2</strong> to:</p>
<p><strong>=VLOOKUP(A2;Pricelist.A$2:B$14317;2;1) * B2</strong></p>
<p>Now you can copy and paste the field without it doing the wrong thing.</p>
<p>BUT you notice that if you DO paste into <strong>C3</strong> without putting the name of anything in <strong>A3</strong>, you get a big lovely <strong>#N/A</strong>.  That means that the function is working, but it&#8217;s not returning a valid value.  That&#8217;s pretty ugly, isn&#8217;t it.  Let&#8217;s fix the display by telling the function to just return a blank string if there&#8217;s noting in <strong>A3</strong>.  We can do that using a Conditional!</p>
<p>We&#8217;re going to use an <strong>IF</strong> statement to check and see if <strong>A3</strong> is blank.  If it is, we&#8217;ll display a blank value.  If not, then we&#8217;ll use our <strong>VLOOKUP</strong> function.</p>
<p><strong>IF</strong> works like this:</p>
<p><strong>IF ( Test; Then_value; Otherwise_value).</strong></p>
<p>For example, if you had a value of &#8220;foo&#8221; in A1 and put this function in B1:</p>
<p>=if (A1=&#8221;foo&#8221;;&#8221;doo&#8221;;&#8221;darn&#8221;)</p>
<p>B1 would see that A1 does indeed = &#8220;foo&#8221;, so it would return &#8220;doo&#8221;.  If we did:</p>
<p>=if(A1=&#8221;poo&#8221;;&#8221;doo&#8221;;&#8221;darn&#8221;)</p>
<p>and A1 was still &#8220;foo&#8221;, then the expression would see that A1 didn&#8217;t equal &#8220;poo&#8221;, so it would return &#8220;darn&#8221;.</p>
<p>Does that make sense?</p>
<p>Here&#8217;s how we&#8217;re going to change our expression in <strong>C2</strong>:</p>
<p><strong>=IF(A2=&#8221;";&#8221;";VLOOKUP(A2;Pricelist.A$2:B$14317;2;1) * B2)</strong></p>
<p>Then copy and paste this into <strong>C3</strong>.  Notice the <strong>#N/A</strong> is gone?  That&#8217;s because we&#8217;re using the IF statement to check and see if A2 is blank.  Since it is, then this reuturns a blank string.  That looks much better!</p>
<p>Now let&#8217;s go ahead and enter another expensive card name in <strong>A3</strong>.. this time let&#8217;s use.. <strong>Badlands (A)</strong>.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection4.png"><img class="aligncenter size-full wp-image-638" title="collection4" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection4.png" alt="collection4" width="355" height="109" /></a></p>
<p>Notice the Value didn&#8217;t update.  That&#8217;s because we didn&#8217;t enter a <strong>count</strong> number.  If we simply change the value of count to <strong>1</strong>, you&#8217;ll see the Value gets updated correctly:</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection5.png"><img class="aligncenter size-full wp-image-639" title="collection5" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection5.png" alt="collection5" width="341" height="105" /></a></p>
<p>Wouldn&#8217;t it be great if by default the count assumed it was always 1?  We can certainly do that by adding another function into our Value function.. <strong>MAX</strong>.</p>
<p><strong>MAX</strong> will take a list of numbers and return the maximum number.  For example:</p>
<p>MAX(1;50) = 50</p>
<p>MAX(0;10;20;-5) = 20</p>
<p>MAX(.5;.7;150;10010) = 10010</p>
<p>Since we know that most of the time we&#8217;ll have 1 or more cards, we can assume that our anything lower than 1 should be returned as&#8230; 1.  So all we need to do is change the part of our function where we get the count from <strong>B2</strong> to <strong>MAX(1;B2)</strong>.  Then if <strong>B2</strong> is 0, it will still return 1.  If it&#8217;s 10, then the funciton will return 10.  Sweet!</p>
<p>Go ahead and change <strong>C2</strong> to the following function and then paste it into <strong>C3:</strong></p>
<p><strong>=IF(A2=&#8221;";&#8221;";VLOOKUP(A2;Pricelist.A$2:B$14317;2;1) * MAX(1;B2))</strong></p>
<p>Notice that <strong>C3</strong> now returns the proper value of the card.. and if you change <strong>B3</strong>, it will still add up correctly.</p>
<p>Nice!</p>
<p>The last bit of the tutorial is probably the coolest.. I can&#8217;t wait for you to see it! <img src='http://jasonschleifer.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You&#8217;ve probably noticed while scrolling through the list of card names that some of the Magic cards can be quite hard to spell..</p>
<p>It would be really easy to accidentally type in a name wrong and get the wrong value, or no value at all.  We could put in some crazy checking, but with 14,316 cards.. I&#8217;d much rather there was an easier way to search and enter card names.</p>
<p>Luckly, there is!</p>
<p>We can use the <strong>Validity</strong> feature of OOCalc!  It&#8217;s a great tool that lets you specify what <em>exactly</em> can be allowed to be entered into a cell.  We&#8217;ll use it on the <strong>Card Name</strong> column to ensure that only the cards shown in the Pricelist<strong> </strong>can be entered!</p>
<p>To do this, select <strong>A2</strong>.</p>
<p>Go <strong>Data -&gt; Validity</strong></p>
<p><strong><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection6.png"><img class="aligncenter size-full wp-image-640" title="collection6" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection6.png" alt="collection6" width="561" height="303" /></a><br />
</strong></p>
<p>This will bring up the Validity window:</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection7.png"><img class="aligncenter size-full wp-image-641" title="collection7" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection7.png" alt="collection7" width="620" height="265" /></a></p>
<p>Here, you can tell oocalc <em>exactly</em> what type of item to allow in the cell.  The coolest thing is that you can choose a <strong>Cell Range</strong>.  That&#8217;s right.. we can pick the range of cells that are in our Pricelist that have the <em>actual names</em> of the cards.  Not only will this limit the input to only allow those names.. but it will actually <em>create a dropdown option box</em> so the person entering the names can <em>just simply pick the one they want</em>!</p>
<p>Yeah, that&#8217;s a LOT of italics, but <em>it&#8217;s so cool!</em></p>
<p>Go ahead and tell it to allow a Cell Range:</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection8.png"><img class="aligncenter size-full wp-image-642" title="collection8" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection8.png" alt="collection8" width="451" height="265" /></a></p>
<p>Now enter the range:</p>
<p><strong>Pricelist.A$2:A$14317</strong></p>
<p>Make sure <strong>Show Selection List</strong> is on.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection8a1.png"><img class="aligncenter size-full wp-image-646" title="collection8a" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection8a1.png" alt="collection8a" width="625" height="282" /></a></p>
<p>Click OK</p>
<p>You&#8217;ll notice that there&#8217;s now a <strong>pulldown</strong> next to <strong>A2</strong>.  Go ahead and click on it.. you&#8217;ll get a pulldown of all the items in the pricelist!</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection10.png"><img class="aligncenter size-full wp-image-644" title="collection10" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/collection10.png" alt="collection10" width="403" height="301" /></a></p>
<p>Just pick the one you want and you&#8217;re done!</p>
<p>The rest is up to you.. just copy and the rows as you need them and you&#8217;ll be able to get the values of each card!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-iii/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Track your Magic The Gathering Collection With OOCalc &#8211; Part II</title>
		<link>http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-ii/</link>
		<comments>http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-ii/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 16:53:48 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[MTG]]></category>
		<category><![CDATA[oocalc]]></category>

		<guid isPermaLink="false">http://jasonschleifer.com/?p=615</guid>
		<description><![CDATA[<p>In my last post on <a href="http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/">Tracking your Magic The Gathering Collection</a>, I introduced the technique on using the VLOOKUP function to help find prices for individual objects based on a previously defined price list.</p> <p>If you recall, we ended up with two tables.. a price list and an itemized list of things we&#8217;re going [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post on <a href="http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/">Tracking your Magic The Gathering Collection</a>, I introduced the technique on using the VLOOKUP function to help find prices for individual objects based on a previously defined price list.</p>
<p>If you recall, we ended up with two tables.. a price list and an itemized list of things we&#8217;re going to purchase, complete with the number of each item, the price per item, and the total cost.  Here&#8217;s the result:</p>
<p><img class="aligncenter size-full wp-image-616" title="purchase6" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/purchase61.png" alt="purchase6" width="351" height="232" /></p>
<p>Now we want to do the same thing, but with the price list for our entire Magic The Gathering collection.</p>
<p>Sweet.</p>
<p>In the last post I mentioned a great site where you can get the current going rate for Magic cards.. <a href="http://www.magictraders.com/">http://www.magictraders.com/</a>.  So the this part of the tutorial will be how to take the price list and create an Open Office Calc spreadsheet with it.</p>
<p>It should be noted that I&#8217;m using <a href="http://openoffice.org">Open Office 3</a> for this tutorial on OS X.  The same principle should apply for Excel, Open Office 2, and most other spreadsheet programs.  I like Open Office because it&#8217;s free.. open source.. and pretty powerful.</p>
<h2>Step 1: Download the price list</h2>
<p>To get the price list, simply go to the MagicTraders website navigate to their <a href="http://www.magictraders.com/pricelists/">pricelists</a>.</p>
<p style="text-align: left;"><a href="http://www.magictraders.com/pricelists/"><img class="aligncenter size-full wp-image-617" title="mtg_pricelist1" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/mtg_pricelist1.png" alt="mtg_pricelist1" width="474" height="313" /></a>You&#8217;ll see that they have a few different price lists you can download.  For my collection, I just needed the Non-Foil Physical Magic Cards, and picked the <strong>Pipe-Delimited Format</strong>. This looks something like:</p>
<pre style="padding-left: 30px;">Card|Price|StdDev|Average|High|Low|Change|Raw N
AErathi Berserker|0.75|0.00|0.75|0.75|0.75|0.00|1
AEther Barrier|0.40|0.10|0.40|0.50|0.30|0.00|2
AEther Burst|0.42|0.12|0.42|0.50|0.25|-0.00|3
AEther Charge|0.25|0.00|0.25|0.25|0.25|0.00|2
AEther Figment|0.27|0.13|0.27|0.56|0.03|0.00|15
AEther Flash (6th)|0.44|0.20|0.44|0.71|0.25|-0.00|3</pre>
<p>By inserting the &#8220;pipe&#8221; or &#8220;|&#8221; character between fields, it&#8217;s very easy for OOCalc to interpret this and turn it into a spreadsheet.  Simply click on the link (you can go there directly by going to: <a href="http://www.magictraders.com/pricelists/current-magic-excel.txt">http://www.magictraders.com/pricelists/current-magic-excel.txt</a>).  This will display the link in your browser.</p>
<p>You can then download this file as a text file simply by going <strong>File-&gt;Save Page As..</strong> and saving the text file somewhere you can find as <strong>current-magic-excel.txt</strong>.</p>
<p>I usually just save mine on my desktop so I can find it easily.</p>
<h2>Step 2: Load the file into OOCalc</h2>
<p>Next, we&#8217;re going to load the file as a spreadsheet into OOCalc.</p>
<p>In OOCalc, choose <strong>File -&gt; Open</strong></p>
<p>Navigate to your desktop (or wherever you saved the file) and load <strong>current-magic-excel.txt</strong>.</p>
<p>Oocalc will launch a <strong>Text Import</strong> wizard that will allow you to specify how Oocalc should interpret the file.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/textImport.png"><img class="aligncenter size-medium wp-image-619" title="textImport" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/textImport-300x205.png" alt="textImport" width="300" height="205" /></a>As you can see, right now it&#8217;s just importing each line as one big field.  We want to break up the items by the &#8220;|&#8221; character.  To do that, we&#8217;re going to click the <strong>other</strong> checkbox, and type a <strong>|</strong> character into the field.  You&#8217;ll imediately notice the difference in how the fields will be imported:</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/textImport2.png"><img class="aligncenter size-medium wp-image-620" title="textImport2" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/textImport2-300x167.png" alt="textImport2" width="300" height="167" /></a>Click <strong>OK</strong> and oocalc will open with the entire price list.  It&#8217;s a big spreadsheet, but the whole thing will be in there loaded just as you&#8217;d like.  Super sweet.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/pricelist5.png"><img class="aligncenter size-medium wp-image-621" title="pricelist5" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/pricelist5-212x300.png" alt="pricelist5" width="212" height="300" /></a></p>
<p>This is a brand new document that Oocalc created.  If you look down at the bottom of the window, you&#8217;ll notice a little tab that says <strong>Sheet1</strong>.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet.png"><img class="aligncenter size-full wp-image-622" title="sheet" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet.png" alt="sheet" width="383" height="149" /></a></p>
<p>What we&#8217;re going to do is insert another &#8220;sheet&#8221; so our document contains two sheets.. one that&#8217;s our collection, and the other that&#8217;s our price list.</p>
<h2>Step 3: Making Multiple Sheets</h2>
<p>Right-click on <strong>Sheet 1</strong> and rename it to &#8220;Pricelist&#8221;.  That way we&#8217;ll have a dedicated sheet that we know is our pricelist.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename.png"><img class="aligncenter size-full wp-image-623" title="sheet_rename" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename.png" alt="sheet_rename" width="240" height="192" /></a></p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename.png"></a><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename2.png"><img class="aligncenter size-full wp-image-624" title="sheet_rename2" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename2.png" alt="sheet_rename2" width="419" height="148" /></a></p>
<p>Click <strong>OK</strong></p>
<p><strong><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename3.png"><img class="aligncenter size-full wp-image-625" title="sheet_rename3" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/sheet_rename3.png" alt="sheet_rename3" width="255" height="114" /></a></strong></p>
<p>Next, we&#8217;ll add another sheet and name it &#8220;Collection&#8221;.</p>
<p>Right-click next to <strong>Pricelist</strong> and choose <strong>Insert Sheet</strong>.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/insertSheet.png"><img class="aligncenter size-full wp-image-626" title="insertSheet" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/insertSheet.png" alt="insertSheet" width="341" height="212" /></a></p>
<p>Name the sheet  <strong>Collection</strong>.</p>
<p><a href="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/insertSheet2.png"><img class="aligncenter size-full wp-image-627" title="insertSheet2" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/insertSheet2.png" alt="insertSheet2" width="644" height="403" /></a></p>
<p>Click <strong>OK</strong></p>
<p>Now you have two sheets in your document.. <strong>Collection</strong> and <strong>Pricelist</strong>.  By clicking on the tabs at the bottom, you can flip back and forth between the two.</p>
<p>Save your document so you don&#8217;t loose any of your hard work!</p>
<p>In the next post, I&#8217;ll show you how to create the collection list, and use the super-crazy-handy <strong>Validity</strong> tool so you don&#8217;t have to type in the names of your cards each time you want to add a new one!</p>
]]></content:encoded>
			<wfw:commentRss>http://jasonschleifer.com/2009/11/14/track-your-magic-the-gathering-collection-with-oocalc-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Track your Magic The Gathering Collection with OOCalc &#8211; Part 1</title>
		<link>http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/</link>
		<comments>http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 06:32:00 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[MTG]]></category>
		<category><![CDATA[oocalc]]></category>

		<guid isPermaLink="false">http://jasonschleifer.com/?p=590</guid>
		<description><![CDATA[<p style="text-align: center;"><a href="http://www.wizards.com/magic/"></a></p> <p style="text-align: left;">Just recently some friends at work have started playing Magic The Gathering again.  MTG was one of the first collectible card games from Wizards of the Coast. I got a bit hooked on it back in the late 90&#8242;s and used to play quite a lot with friends.  The [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.wizards.com/magic/"><img class="size-full wp-image-603 aligncenter" title="Magic Logo" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/Magic-Logo.jpg" alt="Magic Logo" width="400" height="206" /></a></p>
<p style="text-align: left;">Just recently some friends at work have started playing Magic The Gathering again.  MTG was one of the first collectible card games from Wizards of the Coast. I got a bit hooked on it back in the late 90&#8242;s and used to play quite a lot with friends.  The &#8220;official&#8221; definition from Wikipedia goes as follows:</p>
<blockquote style="text-align: center;">
<p style="padding-left: 30px; text-align: left;">Each game represents a battle between powerful <a title="Magician (fantasy)" href="http://en.wikipedia.org/wiki/Magician_%28fantasy%29">wizards</a>, known as &#8220;<a title="Planeswalker" href="http://en.wikipedia.org/wiki/Planeswalker">planeswalkers</a>&#8220;, who use the magical spells, items, and fantastic creatures depicted on individual <em>Magic</em> cards to defeat their opponents. Although the original concept of the game drew heavily from the motifs of traditional <a title="Fantasy" href="http://en.wikipedia.org/wiki/Fantasy">fantasy</a> <a title="Role-playing game" href="http://en.wikipedia.org/wiki/Role-playing_game">role-playing games</a> such as <em><a title="Dungeons &amp; Dragons" href="http://en.wikipedia.org/wiki/Dungeons_%26_Dragons">Dungeons &amp; Dragons</a></em>, the gameplay of <em>Magic</em> bears little resemblance to pencil-and-paper adventure games, while having substantially more cards and more complex rules than many other card games.</p>
</blockquote>
<p style="text-align: left;">There&#8217;s even a <a href="http://www.youtube.com/wizardsmtg">YouTube</a> channel that teaches you how to play!</p>
<p style="text-align: left;">Honestly, it&#8217;s not nearly as geeky as it sounds.  In fact, I believe quite secretly that it was playing this game that really made my wife think &#8220;wow.. this American&#8217;s not nearly as dorky as I first thought!&#8221;</p>
<p style="text-align: left;">Please.  Let me have my delusions.</p>
<p style="text-align: left;"><img class="alignright size-full wp-image-604" style="margin-left: 10px; margin-right: 10px;" title="magic_the_gathering-card_back" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/magic_the_gathering-card_back.jpg" alt="magic_the_gathering-card_back" width="190" height="264" />Anyway, I kind of forgot about the game for the past 6 years or so and was a bit surprised the other night when it came up in conversation.  What was even more surprising was that one of the animators at work mentioned how much his cards were worth the last time he sold them (to protect his identity, I&#8217;ll call him &#8220;Don&#8221;).  Turns out he made quite a healthy buck by selling his cards to a collector over EBay.</p>
<p style="text-align: left;">I realized that I actually have quite a few cards sitting down in my basement that might actually be worth some money, so I pulled them out and started looking through various web sites to try and figure out how much they might be worth.</p>
<p style="text-align: left;">This ended up being incredibly tedious.  For each card I&#8217;d go to EBay, search for the card type, find a few prices, average out what the card was worth and try and come up with a &#8220;good guess&#8221; of what the card is going for.  Every card search was taking 5-10 minutes of investigation.</p>
<p style="text-align: left;">There had to be a better way.</p>
<p style="text-align: left;">I realized that what I really wanted was to get a full list of all the card prices that I could find, then take a list of all the cards I have and cross-reference them to determine the prices.  I did a bit of searching and found an awesome site called <a href="http://www.magictraders.com">http://www.magictraders.com/ </a>that has updated price guides every day and week.  The great thing is that you can download the lists into a text file that is easily slurped into a program like Open Office Calc!  For example, if you go here: <a href="http://www.magictraders.com/pricelists/current-magic-excel.txt">http://www.magictraders.com/pricelists/current-magic-excel.txt</a> you will get something that looks like:</p>
<blockquote style="text-align: left;">
<p style="padding-left: 30px;">Card|Price|StdDev|Average|High|Low|Change|Raw N<br />
AErathi Berserker|0.75|0.00|0.75|0.75|0.75|0.00|1<br />
AEther Barrier|0.60|0.29|0.60|0.99|0.30|0.15|3<br />
AEther Burst|0.42|0.12|0.42|0.50|0.25|-0.00|3<br />
AEther Charge|0.25|0.00|0.25|0.25|0.25|0.00|2<br />
AEther Figment|0.27|0.13|0.27|0.56|0.03|0.01|15<br />
AEther Flash (6th)|0.44|0.20|0.44|0.71|0.25|-0.00|3<br />
AEther Flash (7th)|0.36|0.14|0.36|0.56|0.20|-0.00|7<br />
AEther Flash (WL)|0.34|0.04|0.34|0.37|0.30|-0.00|2<br />
AEther Membrane|0.29|0.05|0.29|0.37|0.25|0.00|4</p></blockquote>
<p style="text-align: left;">Cool, eh?  It has the card name, the price, the average price, high, low, etc etc.  Tons of data.</p>
<p style="text-align: left;">So once I found this, I figured I could just turn that into a table in Open Office Calc and then cross reference it with my list of cards.  But how to do this elegantly?</p>
<p style="text-align: left;">I thought I would start by taking the same concept.. a list of items with a price and see how I could build a way of building a list of how many items I had and how much they cost.</p>
<p style="text-align: left;">I&#8217;ll explain in greater detail.  Let&#8217;s say I wanted to go shopping and I was going to purchase 3 apples, 2 bananas, and one feijoa.  I want to find out how much that&#8217;s going to cost.  I also have a list of a bunch of fruit and how much each item costs.  What I can do is use that second list as data to figure out the total cost of what I&#8217;m going to buy.  Let me show you how.</p>
<p style="text-align: left;">First, I&#8217;m going to create a list of fruit and cost by opening up calc and creating the following list:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-593" title="fruitList" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/fruitList.png" alt="fruitList" width="179" height="99" /></p>
<p style="text-align: left;">As you can see, it&#8217;s a list of fruit and their associated costs per item.  Then I want to build a list of what fruit I&#8217;m going to purchase.  So I added this table to my page:</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-594" title="itemList" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/itemList-300x84.png" alt="itemList" width="300" height="84" /></p>
<p style="text-align: left;">Now I just typed in the fruit and number of each piece that I wanted to purchase:</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-595" title="purchase1" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/purchase1-300x197.png" alt="purchase1" width="300" height="197" /></p>
<p style="text-align: left;">Here you can see both the initial list and the items and amount of each item I want to purchase.  Notice there&#8217;s no price showing up in my purchase list yet.  This is where the fun begins!  What I want to do is cross reference the item with the price from the list above.  For example, in cell <strong>C9</strong>, I want the function to answer the question &#8220;What is the cost of an apple?&#8221;.  Another way to put it is: &#8220;Please look at the item in <strong>A9</strong>.  Find that same item in the list from <strong>A2</strong> to <strong>A5</strong>.  Once you&#8217;ve found that item, tell me what the value is from the B column.&#8221;</p>
<p style="text-align: left;">Fortunately, there&#8217;s a really easy way to get this information using the <strong>VLOOKUP</strong> function.</p>
<p style="text-align: left;">Simply put, the <strong>VLOOKUP</strong> function will allow you to search an array of cells to match a certain string and then return the result from the specified column.</p>
<p style="text-align: left;">In other word: <strong>VLOOKUP</strong>(&lt;string to search for&gt;; &lt;array of cells to search&gt;;&lt;column from the array to return from&gt;;&lt;mode&gt;).</p>
<p style="text-align: left;">In this example I would do:</p>
<p style="text-align: left;"><strong>=VLOOKUP(A9;A2:B5;2;0)</strong></p>
<p style="text-align: left;">So let&#8217;s explain each section.  The first item.. the &#8220;string to search for&#8221; is <strong>A9</strong>.  This is the cell we&#8217;re going to look at.  In the case of row <strong>C9</strong> we&#8217;re asking the vlookup function to search for the word &#8220;apple&#8221;.</p>
<p style="text-align: left;">So where do we want it to search?  Well, we have a price list, so we want it to search in that list, right?  We know apple is SOMEWHERE between <strong>A2</strong> and <strong>A5</strong>.  So we should put that as the array, right?  Well, we could.. but the VLOOKUP function wouldn&#8217;t be able to return the information we want.  The way this function works is you pass it all the columns the function will be dealing with, then you specify which column it&#8217;s going to return from.  We&#8217;re looking for both the name and the price of it, so we enter BOTH columns in our search array: <strong>A2:B5</strong></p>
<p style="text-align: left;">Then we enter the column we&#8217;re going to return the value from.  In this case, <strong>B2</strong> is the value we want.. that&#8217;s in the second column, so we enter <strong>2</strong>.</p>
<p style="text-align: left;">Finally, we tell the function that we don&#8217;t care about sort order, so we set the <strong>mode</strong> to <strong>0</strong>.</p>
<p style="text-align: left;">So here&#8217;s the function that we enter in that cell:</p>
<p style="text-align: left;"><strong>=VLOOKUP(A9;A2:B5;2;0)</strong></p>
<p style="text-align: left;">And what result do we get?</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-610" title="purchase3" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/purchase31.png" alt="purchase3" width="419" height="269" /></p>
<p style="text-align: left;">Pretty nifty, right?</p>
<p style="text-align: left;">Now, let&#8217;s copy that function and paste it into <strong>C10</strong> and see what the result is.  Select <strong>C9</strong>, hit ctrl+c (or command+c on the mac).  Then go to <strong>C10</strong> and hit ctrl+v (command+v on mac).  You should get the price of the banana.</p>
<p style="text-align: left;">This seems pretty straightforward, right?  just copy and paste.. copy and paste.  However, if you check out the function for cell <strong>C10</strong>, you&#8217;ll notice it&#8217;s changed.. the new function is:</p>
<p style="text-align: left;"><strong>=VLOOKUP(A10;A3:B6;2;0)</strong></p>
<p style="text-align: left;">Did you see the difference?</p>
<p style="text-align: left;">The range that the function is searching has <em>shifted down a cell</em>.  Previously the range was <strong>A2:B5</strong> and now it&#8217;s <strong>A3:B6</strong>.  This is because we didn&#8217;t explicitly say what the range should be.  When you enter a cell coordinate into a function, you have to tell open office calc whether or not to shift those cells when you copy and paste.  So how do we do that?</p>
<p style="text-align: left;">OOcalc has a nifty way of locking those cells down.. simply by entering a $ in front of either the Cell or the Row.  So in our case, we need to actually change our initial function in <strong>C9</strong> to this:</p>
<p style="text-align: left;"><strong>=VLOOKUP(A9;A$2:B$6;2;0)</strong></p>
<p style="text-align: left;">Now, if we copy that and paste it into <strong>C10</strong> the function will look like:</p>
<p style="text-align: left;"><strong>=VLOOKUP(A10;A$2:B$6;2;0)</strong></p>
<p style="text-align: left;">Notice that the search area stayed the same, ensuring we&#8217;re searching the correct cells, but the cell representing the string we&#8217;re looking for shifted appropriately (<strong>A9</strong> to <strong>A10</strong>).</p>
<p style="text-align: left;">The next step is to simply copy that function to all the other slots in the <strong>C</strong> row that are appropriate.  In the case of our list, just to <strong>C11</strong>, but if you wanted to buy more produce.. add more lines and go for it!</p>
<p style="text-align: left;">Now that we have the cost of each individual item, we need to tally up the cost based on the number of items we&#8217;re going to purchase.  To do this, select <strong>D9</strong> and enter the following function:</p>
<p style="text-align: left;"><strong>=B9*C9</strong></p>
<h1 style="text-align: left;"><img class="aligncenter size-full wp-image-611" title="purchase4" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/purchase4.png" alt="purchase4" width="355" height="261" /></h1>
<p style="text-align: left;">This will give us the actual cost of each item of fruit.  Copy that function to <strong>D10</strong> and <strong>D11</strong> and we&#8217;ll get the cost for each item we&#8217;re purchasing.</p>
<h1 style="text-align: center;"><img class="aligncenter size-full wp-image-612" title="purchase5" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/purchase5.png" alt="purchase5" width="349" height="102" /></h1>
<p style="text-align: left;">Finally, we want to sum up the total cost.  Here, we&#8217;ll use a simple <strong>SUM</strong> function to get the number of items we&#8217;re purchasing, and the total cost (minus taxes, shipping fees, etc.).</p>
<p style="text-align: left;">In <strong>B13</strong> enter the following function:</p>
<p style="text-align: left;"><strong>=SUM(B9:B12)</strong></p>
<p style="text-align: left;">And then copy that function to <strong>D13</strong> and we&#8217;re done!</p>
<h1 style="text-align: center;"><img class="aligncenter size-full wp-image-613" title="purchase6" src="http://jasonschleifer.com/blog/wp-content/uploads/2009/11/purchase6.png" alt="purchase6" width="351" height="232" /></h1>
<p style="text-align: left;">Now you can see how easy it is to build a list of items based on an initial price list.</p>
<p style="text-align: left;">In the next post, I&#8217;ll talk about how to extend this to creating a really useful way of tracking your Magic Card Collection and value.</p>
]]></content:encoded>
			<wfw:commentRss>http://jasonschleifer.com/2009/11/12/track-your-magic-the-gathering-collection-with-oocalc-part-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

