<?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>super-cooper &#187; excel</title>
	<atom:link href="http://www.super-cooper.com/archive/tag/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.super-cooper.com</link>
	<description>Python, GIS, and a sprinkling of mindless drivel from Chad Cooper</description>
	<lastBuildDate>Sat, 21 Aug 2010 20:22:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The IF function: Excel&#8217;s saving grace</title>
		<link>http://www.super-cooper.com/archive/2005/02/22/excel-if-and-function/</link>
		<comments>http://www.super-cooper.com/archive/2005/02/22/excel-if-and-function/#comments</comments>
		<pubDate>Wed, 23 Feb 2005 03:44:58 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://super-cooper.com/?p=85</guid>
		<description><![CDATA[I sometimes think that if it weren&#8217;t for conditional logic, Excel would be practically useless. I use Excel alot, just about every day. And just about every day, it aggravates me. But then there are the times when I figure something out, some cool way to convert numbers or perform a calculation, and Excel has [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/supercooper/2418903455/" title="excel-and-if-logic by supercooper, on Flickr"><img src="http://farm3.static.flickr.com/2125/2418903455_7ae3a6539f_m.jpg" width="154" height="240" alt="excel-and-if-logic" /></a><br />
I sometimes think that if it weren&#8217;t for conditional logic, Excel would be practically useless. I use Excel alot, just about every day. And just about every day, it aggravates me. But then there are the times when I figure something out, some cool way to convert numbers or perform a calculation, and Excel has redeemed itself. And so goes the love/hate relationship. The love is usually brought on by my using some conditional logic to get a job done. The other day I came across the <code>AND</code> function, which basically allows you to test to see if a condition or set of conditions is true or not. I needed to test for multiple conditions in an <code>IF</code> function, and the <code>AND</code> function did it for me.</p>
<p>My data (see screenshot) had two fields (A and B) that I needed to compare, with my result of the comparison going in column C. If A was greater than B, then put A in C (C5). Simple enough. However, there were some caveats. In columns A and C, I had VOID and (BDL) values. If column B=VOID or B=no value, then my column C value needed to be -9999.0 (to one decimal place).  If B=(BDL), then C=&lt;0.01. And sometimes I had no values at all (A12, B12). So you can see where I needed the test for multiple conditions. This was what I came up with:</p>
<link rel="stylesheet" href="http://www.super-cooper.com/wp-content/plugins/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>=IF(AND(A5&gt;B5,B5&lt;&gt;&quot;&quot;,A5&lt;&gt;&quot;(BDL)&quot;,A5&lt;&gt;&quot;VOID&quot;),A5,IF (B5=&quot;VOID&quot;,FIXED(-9999,1,TRUE),IF(B5=&quot;&quot;, FIXED(-9999,1,TRUE),IF(B5=&quot;(BDL)&quot;, &quot;&lt;0.01&quot;,B5))))</code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.super-cooper.com/snippets/2005/excel-if.txt">excel-if.txt</a></li>
</ol>
<p>The <code>AND</code> allows me to see whether or not multiple conditions are met <em>inside</em> of my logical test for my <code>IF</code> statement. Pretty slick I thought. Now I of course realize that I could have just went through my sheet line by line and manually done this, replacing numbers as I go. I chose not to do that for two reasons: First, I try to never alter my source data, that way I can always go back and look at my original numbers and have confidence in them, and second, what kind of fun would that be? None, of course. Right?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.super-cooper.com/archive/2005/02/22/excel-if-and-function/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Extract day from date in Excel</title>
		<link>http://www.super-cooper.com/archive/2004/08/02/extract-day-from-date-in-excel/</link>
		<comments>http://www.super-cooper.com/archive/2004/08/02/extract-day-from-date-in-excel/#comments</comments>
		<pubDate>Mon, 02 Aug 2004 16:12:07 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://super-cooper.com/?p=36</guid>
		<description><![CDATA[This isn&#8217;t rocket science, but I found it useful (once I got it right), especially when you have 20,000 records to extract the day from, as I often do. This works for dates formatted as such: 1/1/2001 (without leading zeros on the month or day) and will give you the day, in the above case: [...]]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t rocket science, but I found it useful (once I got it right), especially when you have 20,000 records to extract the day from, as I often do. This works for dates formatted as such:</p>
<p>1/1/2001   (without leading zeros on the month or day)</p>
<p>and will give you the day, in the above case: 1</p>
<link rel="stylesheet" href="http://www.super-cooper.com/wp-content/plugins/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>=IF(MID(A10,2,1)=&quot;/&quot;,(IF(MID(A10,4,1)=&quot;/&quot;,MID (A10,3,1),MID(A10,3,2))),(IF(MID(A10,5,1)=&quot;/&quot;, MID(A10,4,1),MID(A10,4,2))))</code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.super-cooper.com/snippets/2004/extract-day-from-date-in-excel-1.txt">extract-day-from-date-in-excel-1.txt</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.super-cooper.com/archive/2004/08/02/extract-day-from-date-in-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
