<?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>nandeshwar.info &#187; Uncategorized</title>
	<atom:link href="http://nandeshwar.info/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://nandeshwar.info</link>
	<description></description>
	<lastBuildDate>Mon, 12 Dec 2011 21:33:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Mining publication data</title>
		<link>http://nandeshwar.info/2010/03/08/mining-publication-data/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mining-publication-data</link>
		<comments>http://nandeshwar.info/2010/03/08/mining-publication-data/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 15:57:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[text mining]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=315</guid>
		<description><![CDATA[I found treasure! Publication and citation data with metadata (author names, addresses, affiliation): http://citeseer.ist.psu.edu/oai.html I was reading about knowledge management here, which says that knowledge management is nonsense. I agree to a certain degree, not because of the field, but because of its name. How do you manage knowledge? Isn&#8217;t knowledge derived? Wasn&#8217;t information &#8220;science&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I found treasure! Publication and citation data with metadata (author names, addresses, affiliation): <a href="http://citeseer.ist.psu.edu/oai.html">http://citeseer.ist.psu.edu/oai.html </a></p>
<p>I was reading about knowledge management <a href="http://informationr.net/ir/8-1/paper144.html?referer=www.clickfind.com.au">here</a>, which says that knowledge management is nonsense. I agree to a certain degree, not because of the field, but because of its name. How do you manage knowledge? Isn&#8217;t knowledge derived? Wasn&#8217;t information &#8220;science&#8221; good enough? (I have problem with &#8220;business intelligence&#8221; as well&#8230;) As the author of that article says, it is a new term coined to attract attention. He does provide some evidence, but I was left unsatisfied.</p>
<p>I thought of performing text mining on publications database, and citeseer has this great resource. I downloaded the data (72 XML files), performed some clean-up, and ran a script to pull citeseer ID, author addresses, and publication dates where the abstract contained the term &#8220;knowledge management&#8221;. I was interested in seeing the trend of publication and places of publication.</p>
<p style="text-align: center;">Have a look at this chart:<br />
<a href="http://nandeshwar.info/wp-content/uploads/2010/03/NoPubsbyYear.JPG"><img class="aligncenter size-full wp-image-317" title="Publications by year" src="http://nandeshwar.info/wp-content/uploads/2010/03/NoPubsbyYear.JPG" alt="Publications by year" width="573" height="587" /></a></p>
<p>There is a definite growth in this area, at least in research and publications. It is startling to see a paper published in 1970, and a peak in 2002. As citeseer data ends in 2004, it is possible that it doesn&#8217;t have complete publication history of 2004.</p>
<p>Geographic location wise, the US and Europe leads the way in number of publications:<br />
<a href="http://nandeshwar.info/wp-content/uploads/2010/03/WorldMapPubs.JPG"><img class="aligncenter size-medium wp-image-318" title="Worldwide Publications " src="http://nandeshwar.info/wp-content/uploads/2010/03/WorldMapPubs-300x168.jpg" alt="Worldwide Publications " width="300" height="168" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2010/03/08/mining-publication-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My experiments with sparklines</title>
		<link>http://nandeshwar.info/2009/09/23/my-experiments-with-sparklines/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-experiments-with-sparklines</link>
		<comments>http://nandeshwar.info/2009/09/23/my-experiments-with-sparklines/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 18:05:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[LaTex]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[sparklines]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=293</guid>
		<description><![CDATA[For the uninitiated, Sparklines are &#8220;data-intense, design-simple, word-sized graphics&#8221; according to its inventor Edward Tufte. I always wanted to include them in my trend reports. The challenge: How and Which tool to use? The data came from this report came from a complex query using SQL server and Access that had this format: College Major [...]]]></description>
			<content:encoded><![CDATA[<p>For the uninitiated, <a title="Sparkline" href="http://en.wikipedia.org/wiki/Sparkline">Sparklines</a> are &#8220;data-intense, design-simple, word-sized graphics&#8221; according to its inventor <a title="Edward Tufte" href="http://en.wikipedia.org/wiki/Edward_Tufte">Edward Tufte</a>. I always wanted to include them in my trend reports. The challenge: How and Which tool to use?</p>
<p>The data came from this report came from a complex query using SQL server and Access that had this format:</p>
<table border="0">
<tbody>
<tr>
<td>College</td>
<td>Major</td>
<td>2005</td>
<td>2006</td>
<td>2007</td>
<td>2008</td>
<td>2009</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>10</td>
<td>15</td>
<td>14</td>
<td>18</td>
<td>25</td>
</tr>
</tbody>
</table>
<p>Some options I investigated and tried (be sure to read <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Lk">this page</a>, you might find many more):</p>
<ul>
<li>Google&#8217;s Chart API (<a href="http://code.google.com/apis/chart/types.html">http://code.google.com/apis/chart/types.html</a>): you can embed these in Google spreadsheets,  create HTML pages using <a href="http://www.cazh1.com/blogger/thoughts/2009/01/hacking-google-chart-api-from-excel.shtml">Excel via VBA</a>, or embed them in<a href="http://www.tushar-mehta.com/publish_train/xl_vba_cases/excel_google_chart_api/index.htm"> Excel sheets</a>. Alas, none would work the way I would like them to work: In-cell graphics</li>
<li> <a href="http://sparklines-excel.blogspot.com/">Use Sparklines for Excel add-in</a>: this add-in will create great in-cell charts (bar, bullet graphs, sparklines, etc), but copying them down is difficult and resource intensive, and any change you make in the column size will alter the shape of that chart. In addition, I had more than 400 rows to populate&#8211;these would be too many objects in a spreadsheet for Excel to handle. My machine froze when I tried to copy it for 10 rows.</li>
<li>Use R&#8217;s implementation by Jason Dieterle (search on <a href="http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000Lk">this page</a> for Jason Dieterle (email), January 28, 2008. Works very good. I modified the code to print max and mins only, but the function generates a graphic, which needed to be embeded in LaTex file. It did not work nicely. Charts were too big to fit in a cell of a table.</li>
<li>Create bar charts in <a href="http://www.juiceanalytics.com/writing/lightweight-data-exploration-in-excel/">Excel using REPT function</a>. I tried different font sizes and styles, but it didn&#8217;t look pretty, for the range of data varied. (Hint: make the alignment of text 90, use pipe signs, create columns and graphs for each data value, remove gridlines, keep the columns very close. It almost worked.)</li>
<li>Use <a href="http://jblevins.org/projects/spark/">spark</a> package for LaTex, doesn&#8217;t work in pdflatex, and you have to play a lot with the settings</li>
<li>Use <a href="http://www.ctan.org/tex-archive/help/Catalogue/entries/sparklines.html">sparklines </a>package for LaTex. Problem was that data needed to be normalized (or scaled) from 0 to 1, and needed extra parameters for min and max points. Solution: create a normalize function in Excel, and write a big formula to produce the exact needed string for the sparklines to work i.e.:<br />
<code>\begin{sparkline}{5}<br />
\sparkdot 1 1 blue<br />
\sparkdot 0.2 0 red<br />
\spark 0.2 0 0.4 0.0625 0.6 0.5625 0.8 0.75 1 1 /<br />
\end{sparkline}</code></li>
</ul>
<p>Here&#8217;s the normalize function:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Public</span> <span style="color: #000080;">Function</span> Normalize(cell2Normalize <span style="color: #000080;">As</span> Range, WholeRng <span style="color: #000080;">As</span> Range)
       Normalize = (cell2Normalize.Value - WorksheetFunction.Min(WholeRng)) / (WorksheetFunction.Max(WholeRng) - WorksheetFunction.Min(WholeRng))
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>Here&#8217;s the big formula to convert the range for data values from 2005 to 2009 (in the range E2:I2) to the sparkline LaTex environment.<br />
<code><br />
="\begin{sparkline}{5} " &amp; "\sparkdot " &amp; CHOOSE(MATCH(MAX(E2:I2),E2:I2,0),0.2,0.4,0.6,0.8,1) &amp; " " &amp; 1 &amp; " blue " &amp; "\sparkdot " &amp; CHOOSE(MATCH(MIN(E2:I2),E2:I2,0),0.2,0.4,0.6,0.8,1) &amp; " " &amp; 0 &amp; " red " &amp; " \spark 0.2 " &amp; Normalize(E2,E2:I2) &amp; " 0.4 " &amp; Normalize(F2,E2:I2) &amp; " 0.6 " &amp; Normalize(G2,E2:I2) &amp; " 0.8 " &amp; Normalize(H2,E2:I2) &amp; " 1 " &amp; Normalize(I2,E2:I2) &amp; " / \end{sparkline}"</code></p>
<p>This last option worked beautifully. I dragged the formula down. I selected the data, and clicked on &#8220;Convert Table to LaTex&#8221; button (using this<a href="http://dataninja.wordpress.com/2006/01/20/excel-to-latex/"> add-in</a>). Copied the LaTex code to clipboard and pasted it in my LaTex editor. Manually merged the rows for colleges (using \multirow), and generated a beautiful looking pdf.</p>
<p>I was very happy. Printed it in color. Got a request back very soon that there should be total rows.</p>
<p>I forgot about the sparklines and created a report in Access with plain old numbers in less than 15 mins. Gave it back.</p>
<p>I tried to repeat this &#8211; <a href="http://www.youtube.com/watch?v=EK73YYo0CUk">Sparkline in Cognos</a> -in Access with no luck.</p>
<p>(I later tried it one more time: Got the data in Excel using External data&gt; Access, created a pivottable with rows and all, did some formatting, copied and pasted values and formats, inserted sparkline code, converted it to LaTex, copied and pasted in LaTex editor, and here&#8217;s the beautiful looking <a href="http://nandeshwar.info/wp-content/uploads/2009/09/CollegeEnrSample.pdf">sample pdf</a> of 16)</p>
<p>I wish there were simple reporting solutions that included awesome data visualization tools. (BTW, Excel 2010 will have sparklines: <a href="http://blogs.msdn.com/excel/archive/2009/07/17/sparklines-in-excel.aspx">link</a>) For this report, I did try Sweave, R, and LaTex, but because of the time constraints I could not investigate it further.</p>
<p>Please comment if you know any other way which meet (or don&#8217;t, Tableau is certainly one) these conditions: inexpensive (read free), efficient,  and repeatable.</p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2009/09/23/my-experiments-with-sparklines/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tag Cloud of Data Mining Jobs</title>
		<link>http://nandeshwar.info/2009/08/20/tag-cloud-of-data-mining-jobs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tag-cloud-of-data-mining-jobs</link>
		<comments>http://nandeshwar.info/2009/08/20/tag-cloud-of-data-mining-jobs/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 14:13:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[data mining]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[stemming]]></category>
		<category><![CDATA[tag cloud]]></category>
		<category><![CDATA[text mining]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=260</guid>
		<description><![CDATA[Here&#8217;s what I did to get a cool looking tag cloud of data mining jobs: Used Yahoo Pipes (I created mine, but this one has more feeds)&#8211; this pipe aggregates feeds from different job web-sites, and gives the user unique job listing that you can subscribe via RSS: Job Feed Aggregator by Sean Dolan Subscribed [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s what I did to get a cool looking tag cloud of data mining jobs:</p>
<ol>
<li>Used Yahoo Pipes (I created mine, but this one has more feeds)&#8211; this pipe aggregates feeds from different job web-sites, and gives the user unique job listing that you can subscribe via RSS:  <a href="http://pipes.yahoo.com/pipes/pipe.info?_id=50bf0b7cbcf40213deb98f1314dedf51">Job Feed Aggregator by Sean Dolan </a></li>
<li>Subscribed to the RSS feed for the keyword &#8220;data mining&#8221;</li>
<li>Copied the job descriptions and requirements of many jobs, and saved the text file</li>
<li>Got the <a href="http://tartarus.org/~martin/PorterStemmer/index-old.html">python stemmer </a></li>
<li>Applied the python stemmer to the text file. Stemmer truncates words to their roots, so that we can combine variants of a word into a single word. (First or second step in text mining)</li>
<li>Created a tag cloud using the services of <a href="http://www.wordle.net/">http://www.wordle.net/</a> . They use &#8220;stop words,&#8221; so I didn&#8217;t have to apply those. Stop words are common words, which necessarily don&#8217;t add any value for categorization, of a language.</li>
</ol>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 591px"><a href="http://nandeshwar.info/wp-content/uploads/2009/08/dmjobstagcloud.jpg"><img class="size-full wp-image-261 " title="Data Mining Jobs Tag Cloud" src="http://nandeshwar.info/wp-content/uploads/2009/08/dmjobstagcloud.jpg" alt="Data Mining Jobs Tag Cloud" width="581" height="249" /></a><p class="wp-caption-text">Data Mining Jobs Tag Cloud</p></div>
<p><!--adsensestart--><br />
The most frequent word is: experience. Companies want people with experience in different data mining techniques. You&#8217;ll see that some other big words are: SAS (stemmed as sa), Excel, SQL, analytical skills, statistics, and quantitative skills.</p>
<p>And how do you master these skills, you ask?</p>
<ol>
<li>Get a graduate degree in statistics, economics, mathematics, computer science, financial engineering, or industrial engineering with emphasis on databases, data mining, and marketing.</li>
<li>Successfully complete data mining projects using free, open-source data mining tools, such as Weka, R, Orange, Rapid-Miner.</li>
<li>Participate in data mining competitions. SAS&#8217;s data mining conference has a data mining competition every year.</li>
</ol>
<p>Have a look at a detailed study by Pejic Bach, M: Creating profile of data mining specialist</p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2009/08/20/tag-cloud-of-data-mining-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto Filter Cursor Movement</title>
		<link>http://nandeshwar.info/2009/06/01/auto-filter-cursor-movement/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=auto-filter-cursor-movement</link>
		<comments>http://nandeshwar.info/2009/06/01/auto-filter-cursor-movement/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 19:09:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[filter]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=250</guid>
		<description><![CDATA[Don&#8217;t you hate it when you are working with many fields and you want to filter a particular field, so you apply auto filter on the all fields, but you find out that the field you were working on is gone from your sight and you see A1 cell. I did. Not anymore. Solution: Simply [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t you hate it when you are working with many fields and you want to filter a particular field, so you apply auto filter on the all fields, but you find out that the field you were working on is gone from your sight and you see A1 cell. I did. Not anymore.</p>
<p><strong>Solution</strong>: Simply hit the left or the right arrow key, and it will take you to the left or the right cell of the field you were working on.</p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2009/06/01/auto-filter-cursor-movement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things they didn&#8217;t teach in school</title>
		<link>http://nandeshwar.info/2009/05/22/things-they-didnt-teach-in-school/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=things-they-didnt-teach-in-school</link>
		<comments>http://nandeshwar.info/2009/05/22/things-they-didnt-teach-in-school/#comments</comments>
		<pubDate>Fri, 22 May 2009 19:10:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[LaTex]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=237</guid>
		<description><![CDATA[My gripe about graduate school is that the school focused on well-established software and never embraced nor encouraged open-source software. If they had taught, or at least introduced, these following open-source software, it would have helped us immensely to produce the best looking reports with great data analysis. We, however, had to struggle with SAS/Excel [...]]]></description>
			<content:encoded><![CDATA[<p>My gripe about graduate school is that the school focused on well-established software and never embraced nor encouraged open-source software. If they had taught, or at least introduced, these following open-source software, it would have helped us immensely to produce the best looking reports with great data analysis. We, however, had to struggle with SAS/Excel to get the graphs and analysis needed, and then spend hours to perform formatting in Word. Why they didn&#8217;t teach us:</p>
<ol>
<li>LaTex: a powerful typeset editor, where you focus on writing and not on formatting. It takes care of all the headings, page numbering, figure/table/equation numbering, TOC, bibliography/citation, and more. Although the learning curve is rather steep, once you get the hang of it, life becomes so easy. For windows: you need to get <a href="http://miktex.org/">MikTex</a> and any LaTex editor, such as <a href="http://www.latexeditor.org/">LEd</a>, <a href="http://www.lyx.org/">LyX</a>, or <a href="http://www.winedt.com/">WinEd</a></li>
<li> <a href="http://www.r-project.org/">R</a>: awesome statistical package with wonderful graphics components. Producing stunning graphics and statistics has never been easy. It had me at <span style="color: #ff0000;"><code>summary</code></span>.  Any software that can do produce the following, just by giving <span style="color: #ff0000;"><code>summary(iris)</code></span> command has to be great:</li>
</ol>
<div id="attachment_244" class="wp-caption alignnone" style="width: 387px"><a href="http://nandeshwar.info/wp-content/uploads/2009/05/iris_summary_r.jpg"><img class="size-full wp-image-244" title="iris_summary_r" src="http://nandeshwar.info/wp-content/uploads/2009/05/iris_summary_r.jpg" alt="Summary produced by R of the iris data set" width="377" height="238" /></a><p class="wp-caption-text">Summary produced by R of the iris data set</p></div>
<p>In my thesis, I had plenty of equations, and every time I made some significant changes, MS Word happily would turn those equations into empty white boxes &#8212; and then I had to rewrite them. In retrospect, I find it ridiculous that I was entering citations manually. So every time I added a new reference, I would manually change the bibliography page and the page where I cited that reference. With LaTex, it is just a breeze to do all this.</p>
<p>Descriptive stats, Box-plots, normal curves, neural network, charts with LaTex equations, and a lot of more stuff, all could be easily done using R, and the best part is &#8220;repeatability.&#8221; With simple commands, you could export all the charts as images for various data sets or for various training algorithms. No sweat! Try that with Excel. (I did some years ago).</p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2009/05/22/things-they-didnt-teach-in-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Sheets based on a Column</title>
		<link>http://nandeshwar.info/2008/11/10/create-sheets-based-on-a-column/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=create-sheets-based-on-a-column</link>
		<comments>http://nandeshwar.info/2008/11/10/create-sheets-based-on-a-column/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 16:30:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Create Sheets]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[Range Cells]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2008/11/10/create-sheets-based-on-a-column/</guid>
		<description><![CDATA[Ever felt the need of creating different sheets based on the distinct values of a column. For example, in your data, you have a column called STATE, and you would like to create a separate sheet for each state with all the data from that state. Here&#8217;s your solution then:(Note: you&#8217;ll need to add a [...]]]></description>
			<content:encoded><![CDATA[<p>Ever felt the need of creating different sheets based on the distinct values of a column. For example, in your data, you have a column called STATE, and you would like to create a separate sheet for each state with all the data from that state. Here&#8217;s your solution then:<br />(Note: you&#8217;ll need to add a UDF function UniqueItems from http://j-walk.com/ss/excel/tips/tip15.htm)</p>
<p>This procedure will create a new sheet for each unique item in the selected column with the data from the main sheet for that unique item. As an added bonus, the procedure will sort the sheets ascending (Courtesy:ozgrid.com) <br /><font face="Courier"><span style="color:#007F00;">&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</span><br /><span style="color:#007F00;">&#8216; Procedure : CreateSheetsColumn</span><br /><span style="color:#007F00;">&#8216; DateTime&#160;&#160;: 11/10/2008 09:32</span><br /><span style="color:#007F00;">&#8216; Author&#160;&#160;&#160;&#160;: ARN</span><br /><span style="color:#007F00;">&#8216; Purpose&#160;&#160; : To create sheets with the data from the main sheet based on a selected column.</span><br /><span style="color:#007F00;">&#8216;Assumptions:</span><br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8217;1 -&#160;&#160;data are in contigious form</span><br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8217;2 &#8211; the unique column does not have any special characters</span><br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8217;3 &#8211; the first row is the header row</span><br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8217;4 &#8211; the only sheet in the workbook is the data workbook</span><br /><span style="color:#007F00;">&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</span><br /><span style="color:#007F00;">&#8216;</span><br /><span style="color:#00007F;">Public</span> <span style="color:#00007F;">Sub</span> CreateSheetsColumn()</p>
<p><span style="color:#00007F;">On</span> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> CreateSheetsColumn_Error<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Dim</span> rngInput <span style="color:#00007F;">As</span> Range, rngColAddr <span style="color:#00007F;">As</span> Range, varrUniqueVals() <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span>, dCounter <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Dim</span> rngCol <span style="color:#00007F;">As</span> Range<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Dim</span> dUniqueItems <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span>, dColtoFilterOn <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span><br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Dim</span> lCount <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, lShtLast <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, lCount2 <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span><br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;Set the working range</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Set</span> rngInput = ActiveSheet.Range(Cells(1, 1), Cells(1, 1).SpecialCells(xlLastCell))<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;get the column to work on from the user</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Set</span> rngColAddr = Application.InputBox(prompt:=&#8221;Select the column that would be used to create distinct sheets&#8221;, _<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Title:=&#8221;Select a Column&#8221;, _<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Type:=8)<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;if more than one column is selected, exit</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">If</span> rngColAddr.Columns.Count &gt; 1 <span style="color:#00007F;">Then</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;MsgBox &#8220;Too many columns; select only one column&#8221;, vbOKOnly<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">Exit</span> <span style="color:#00007F;">Sub</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;set the application screen updating to false to increase execution speed</span><br />&#160;&#160;&#160;&#160;Application.ScreenUpdating = <span style="color:#00007F;">False</span><br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;store the column number in a variable</span><br />&#160;&#160;&#160;&#160;dColtoFilterOn = rngColAddr.Column<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;set a range from the 2nd row to the last row from the selected column to get the distinct values</span><br />&#160;&#160;&#160;&#160;Set rngCol = ActiveSheet.Range(Cells(2, dColtoFilterOn), Cells(rngInput.Rows.Count, dColtoFilterOn))<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;use the function UniqueItems (http://j-walk.com/ss/excel/tips/tip15.htm) to get unique values from the selected column</span><br />&#160;&#160;&#160;&#160;varrUniqueVals = UniqueItems(rngCol, <span style="color:#00007F;">False</span>)<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;get the total number of unique items</span><br />&#160;&#160;&#160;&#160;dUniqueItems = <span style="color:#00007F;">UBound</span>(varrUniqueVals, 1)<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;start a loop to filter the range on each unique item</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">For</span> dCounter = 1 <span style="color:#00007F;">To</span> dUniqueItems<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216; only if the unique value is not blank</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">If</span> <span style="color:#00007F;">Not</span> varrUniqueVals(dCounter) = &#8220;&#8221; <span style="color:#00007F;">Then</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216; apply filter</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rngInput.AutoFilter Field:=dColtoFilterOn, Criteria1:=varrUniqueVals(dCounter)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;add a new sheet</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Sheets.Add After:=Sheets(Sheets.Count)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;rename the sheet</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ActiveSheet.Name = varrUniqueVals(dCounter)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;"<br />
>&#8216;copy the filtered data</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rngInput.Copy Destination:=Worksheets(varrUniqueVals(dCounter)).Range(&#8220;A1&#8243;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;remove copy</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Application.CutCopyMode = <span style="color:#00007F;">False</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Next</span> dCounter<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;remove filter</span><br />&#160;&#160;&#160;&#160;rngInput.AutoFilter<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216; Sort sheets ascending &#8211; except the first one</span><br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216; copied from http://www.ozgrid.com/VBA/sort-sheets.htm</span><br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;lShtLast = Sheets.Count<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">For</span> lCount = 2 <span style="color:#00007F;">To</span> lShtLast<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">For</span> lCount2 = lCount <span style="color:#00007F;">To</span> lShtLast<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">If</span> UCase(Sheets(lCount2).Name) &lt; UCase(Sheets(lCount).Name) <span style="color:#00007F;">Then</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Sheets(lCount2).Move Before:=Sheets(lCount)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">Next</span> lCount2<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">Next</span> lCount<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />MsgBox &#8220;Done&#8221;</p>
<p><span style="color:#00007F;">On</span> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> 0<br />SmoothExit_CreateSheetsColumn:</p>
<p>&#160;&#160;&#160;&#160;Application.ScreenUpdating = <span style="color:#00007F;">True</span></p>
<p>&#160;&#160;&#160;&#160;<span style="color:#00007F;">Exit</span> <span style="color:#00007F;">Sub</span></p>
<p>CreateSheetsColumn_Error:<br />&#160;&#160;&#160;&#160;MsgBox &#8220;Error &#8221; &amp; Err.Number &amp; &#8221; (&#8221; &amp; Err.Description &amp; &#8220;) in Sub:CreateSheetsColumn&#8221;<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Resume</span> SmoothExit_CreateSheetsColumn<br /><span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span><br /></font></p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2008/11/10/create-sheets-based-on-a-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Student&#8217;s t-test for equal means</title>
		<link>http://nandeshwar.info/2008/10/29/students-t-test-for-equal-means/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=students-t-test-for-equal-means</link>
		<comments>http://nandeshwar.info/2008/10/29/students-t-test-for-equal-means/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 13:06:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Operations]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Useful Procedures]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[UDF]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2008/10/29/students-t-test-for-equal-means/</guid>
		<description><![CDATA[If you do not wish to enter complex formula in Excel and you already have calculated average, count, and variance for your samples(Tip:use a PivotTable), then you can use these user-defined functions to calculate the t-test stat value and degrees of freedom required to do hypothesis testing. Both the functions provide an optional argument for [...]]]></description>
			<content:encoded><![CDATA[<p>If you do not wish to enter complex formula in Excel and you already have calculated average, count, and variance for your samples(Tip:use a PivotTable), then you can use these user-defined functions to calculate the t-test stat value and degrees of freedom required to do hypothesis testing. Both the functions provide an optional argument for the assumption of equal variances; by default it is set to false.</p>
<p>Here&#8217;s the code for t-test:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'---------------------------------------------------------------------------------------
</span><span style="color: #008000;">' Procedure : TTESTM
</span><span style="color: #008000;">' DateTime  : 10/29/2008 08:35
</span><span style="color: #008000;">' Author    :
</span><span style="color: #008000;">' Purpose   : To get the t-stat value when comparing two means with an optional input
</span><span style="color: #008000;">'               for equal or unequal variances
</span><span style="color: #008000;">'               by default the function assumes that the user is comparing means with unequal variances
</span><span style="color: #008000;">' davg1 is the mean of first sample
</span><span style="color: #008000;">' dcnt1 is the sample size of sample 1 
</span><span style="color: #008000;">' dvar1 is the variance of first samaple 
</span><span style="color: #008000;">' davg2 is the mean of second sample
</span><span style="color: #008000;">' dcnt2 is the sample size of sample 2 
</span><span style="color: #008000;">' dvar2 is the variance of second samaple 
</span><span style="color: #008000;">' blnEqVar set TRUE to assume equal variance for the test
</span><span style="color: #008000;">'---------------------------------------------------------------------------------------
</span>
<span style="color: #000080;">Public</span> <span style="color: #000080;">Function</span> TTESTM(davg1 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dcnt1 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dvar1 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, davg2 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dcnt2 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dvar2 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, <span style="color: #000080;">Optional</span> blnEqVar <span style="color: #000080;">As</span> <span style="color: #000080;">Boolean</span> = <span style="color: #000080;">False</span>) <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
&nbsp;
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> TTESTM_Error
<span style="color: #000080;">Dim</span> dResult <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dNumer <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dDenon <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dPooledVar <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
&nbsp;
dNumer = davg1 - davg2
&nbsp;
<span style="color: #008000;">'if equal variances are not assumed
</span><span style="color: #008000;">'http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm
</span><span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> blnEqVar <span style="color: #000080;">Then</span>
	dDenon = Sqr((dvar1 ^ 2 / dcnt1) + (dvar2 ^ 2 / dcnt2))
<span style="color: #000080;">Else</span>
<span style="color: #008000;">'if equal variances are assumed, then calculated the pooled variance
</span>	dPooledVar = Sqr((((dcnt1 - 1) * dvar1 ^ 2) + ((dcnt2 - 1) * dvar2 ^ 2)) / (dcnt1 + dcnt2 - 2))
	dDenon = dPooledVar * Sqr((1 / dcnt1) + (1 / dcnt2))
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
dResult = dNumer / dDenon
&nbsp;
TTESTM = dResult
<span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
&nbsp;
TTESTM_Error:
	TTESTM = Null
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>Code for degrees of freedom</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'---------------------------------------------------------------------------------------
</span><span style="color: #008000;">' Procedure : DOFTTESTM
</span><span style="color: #008000;">' DateTime  : 10/29/2008 08:50
</span><span style="color: #008000;">' Author    :
</span><span style="color: #008000;">' Purpose   : To get the degrees of freedom for the t-test when comparing two means with an optional input
</span><span style="color: #008000;">'               for equal or unequal variances
</span><span style="color: #008000;">'               by default the function assumes that the user is comparing means with unequal variances
</span>
<span style="color: #008000;">' dcnt1 is the sample size of sample 1 
</span><span style="color: #008000;">' dvar1 is the variance of first samaple 
</span><span style="color: #008000;">' dcnt2 is the sample size of sample 2 
</span><span style="color: #008000;">' dvar2 is the variance of second samaple 
</span><span style="color: #008000;">' blnEqVar set TRUE to assume equal variance for the test
</span><span style="color: #008000;">'---------------------------------------------------------------------------------------
</span><span style="color: #008000;">'
</span><span style="color: #000080;">Public</span> <span style="color: #000080;">Function</span> DOFTTESTM(dcnt1 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dvar1 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dcnt2 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dvar2 <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, <span style="color: #000080;">Optional</span> blnEqVar <span style="color: #000080;">As</span> <span style="color: #000080;">Boolean</span> = <span style="color: #000080;">False</span>) <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
&nbsp;
<span style="color: #000080;">Dim</span> dResult <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dNumer <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>, dDenon <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
&nbsp;
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> DOFTTESTM_Error
<span style="color: #008000;">'if equal variances are not assumed, then use a complicated formula to compute degrees of freedom
</span><span style="color: #008000;">'http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm
</span><span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> blnEqVar <span style="color: #000080;">Then</span>
	dNumer = ((dvar1 ^ 2 / dcnt1) + (dvar2 ^ 2 / dcnt2)) ^ 2
	dDenon = ((dvar1 ^ 2 / dcnt1) ^ 2 / (dcnt1 - 1)) + ((dvar2 ^ 2 / dcnt2) ^ 2 / (dcnt2 - 1))
	dResult = dNumer / dDenon
<span style="color: #000080;">Else</span>
	dResult = dcnt1 + dcnt2 - 2
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
&nbsp;
DOFTTESTM = dResult
&nbsp;
<span style="color: #000080;">Exit</span> <span style="color: #000080;">Function</span>
&nbsp;
DOFTTESTM_Error:
	DOFTTESTM = Null
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2008/10/29/students-t-test-for-equal-means/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel Training Handout</title>
		<link>http://nandeshwar.info/2007/10/23/excel-training-handout/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=excel-training-handout</link>
		<comments>http://nandeshwar.info/2007/10/23/excel-training-handout/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 13:03:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2007/10/23/excel-training-handout/</guid>
		<description><![CDATA[Recently, I conducted a training session for Ohio Association for Institutional Research and Planning (OAIRP). Here are the files that I used for the training: handout.pdf Excercise.xls Formulae.xls]]></description>
			<content:encoded><![CDATA[<p>Recently, I conducted a training session for Ohio Association for Institutional Research and Planning (<a href="http://www.oairp.org/">OAIRP</a>). Here are the files that I used for the training:
<ul>
<li><a href="http://www.nandeshwar.info/projects/xlblog/files/handout.pdf">handout.pdf</a></li>
<p>
<li><a href="http://www.nandeshwar.info/projects/xlblog/files/Excercise.xls">Excercise.xls</a></li>
<p>
<li><a href="http://www.nandeshwar.info/projects/xlblog/files/Formulae.xls">Formulae.xls</a></li>
<p></ul>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2007/10/23/excel-training-handout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert Text to Uppercase</title>
		<link>http://nandeshwar.info/2007/09/17/convert-text-to-uppercase/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=convert-text-to-uppercase</link>
		<comments>http://nandeshwar.info/2007/09/17/convert-text-to-uppercase/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 13:21:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Operations]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Useful Procedures]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[UDF]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2007/09/17/convert-text-to-uppercase/</guid>
		<description><![CDATA[If you want to convert the text to uppercase, use the following code; however, I recommend downloading ASAP Utilities, it has many functionalities, including text conversion. It doesn&#8217;t offer source code though. Here&#8217;s my code for uppercase conversion:(If you want to convert your text to lowercase, replace Ucase with Lcase function in the code) &#8216;Will [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to convert the text to uppercase, use the following code; however, I recommend downloading <a href="http://www.asap-utilities.com/">ASAP Utilities</a>, it has many functionalities, including text conversion. It doesn&#8217;t offer source code though. </p>
<p>Here&#8217;s my code for uppercase conversion:<br />(If you want to convert your text to lowercase, replace Ucase with Lcase function in the code)
<div id="code"><font face="Courier"><span style="color:#007F00;">&#8216;Will convert selected range to Upper case, using array</span><br /><span style="color:#00007F;">Sub</span> Conv2UCase()<br /><span style="color:#00007F;">On</span> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> Conv2UCase_Error</p>
<p><span style="color:#00007F;">Dim</span> vDataArr <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span><br /><span style="color:#00007F;">Dim</span> lUpperBndRow <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, lUpperBndCol <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span><br /><span style="color:#00007F;">Dim</span> lRow <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, lCol <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span></p>
<p><span style="color:#007F00;">&#8216;store selected values in an array</span><br />vDataArr = Selection<br /><span style="color:#007F00;">&#8216;get the upper bound of rows</span><br />lUpperBndRow = <span style="color:#00007F;">UBound</span>(vDataArr, 1)<br /><span style="color:#007F00;">&#8216;get the upper bound of cols</span><br />lUpperBndCol = <span style="color:#00007F;">UBound</span>(vDataArr, 2)</p>
<p><span style="color:#007F00;">&#8216;Start a loop to go through all the elements of the array</span><br /><span style="color:#00007F;">For</span> lRow = 1 <span style="color:#00007F;">To</span> lUpperBndRow<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">For</span> lCol = 1 <span style="color:#00007F;">To</span> lUpperBndCol<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;Check if the value is text, if not don&#8217;t convert</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">If</span> WorksheetFunction.IsText(vDataArr(lRow, lCol)) <span style="color:#00007F;">Then</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;Convert values to upper case</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;vDataArr(lRow, lCol) = UCase(vDataArr(lRow, lCol))<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Next</span> lCol<br /><span style="color:#00007F;">Next</span> lRow<br /><span style="color:#007F00;">&#8216;Return the converted values to the range</span><br />Selection = vDataArr<br /><span style="color:#00007F;">Exit</span> <span style="color:#00007F;">Sub</span></p>
<p>Conv2UCase_Error:<br />&#160;&#160;&#160;&#160;MsgBox &#8220;Error &#8221; &amp; Err.Number &amp; &#8221; (&#8221; &amp; Err.Description &amp; &#8220;) in Sub:Conv2UCase&#8221;<br /><span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span></font></div>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2007/09/17/convert-text-to-uppercase/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Print Structures of dbf files in separate workbooks</title>
		<link>http://nandeshwar.info/2007/07/24/print-structures-of-dbf-files-in-separate-workbooks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=print-structures-of-dbf-files-in-separate-workbooks</link>
		<comments>http://nandeshwar.info/2007/07/24/print-structures-of-dbf-files-in-separate-workbooks/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 15:48:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DBF]]></category>
		<category><![CDATA[Delete Shift]]></category>
		<category><![CDATA[Print Structures]]></category>
		<category><![CDATA[Range A1]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2007/07/24/print-structures-of-dbf-files-in-separate-workbooks/</guid>
		<description><![CDATA[Recently, I had the need of printing the data structures of many dbf files. A google search reveled the DBF.COM file that would output dbf file structures, number of records, file name, date of last update, etc. Download this file here: files/DBF.COM (Caution: I downloaded this file from the internet, and I do not make [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I had the need of printing the data structures of many dbf files. A google search reveled the DBF.COM file that would output dbf file structures, number of records, file name, date of last update, etc. </p>
<p>Download this file here: <a href="http://www.nandeshwar.info/projects/xlblog/files/DBF.COM">files/DBF.COM</a> (Caution: I downloaded this file from the internet, and I do not make any warranty of it being spyware or malicious ware free. Use it on your own risk.) </p>
<p>To use this file go to Start&gt;Run&gt;cmd and in DOS type: 
<div id="code">cd C:/<span style="font-style:italic;"></span></p>
<p>dbf.com &gt; myfilestru.txt </p></div>
<p><span style="font-style:italic;">Note: cd is used to change the current directory</span></p>
<p>Here&#8217;s a print screen:<br /><img src="http://www.nandeshwar.info/projects/xlblog/uploaded_images/doscommand-764218.JPG" border="0" alt="" /></p>
<p>This will create a file myfilestru.txt in the same directory where your dbf files are residing. This text file will look like this:<br /><img src="http://www.nandeshwar.info/projects/xlblog/uploaded_images/filestruct-745759.JPG" border="0" alt="" /></p>
<p>Now, that we have a text file all the file structures, we need to create separate workbooks for each dbf file. To do that open this text file in Excel, press Alt + F11 to view the VBA window, double-click the sheet name, and paste this code. After that run this code, and you should have separate workbooks for each dbf file.</p>
<div id="code"><font face="Courier"><span style="color:#00007F;">Sub</span> FormatThisFile()<br /><span style="color:#007F00;">&#8216;Define some variables</span><br /><span style="color:#00007F;">Dim</span> iLastRow <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span>, i <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span>, sWrkbkNm <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span>, sNewWrkbkNm <span style="color:#00007F;">As</span> <span style="color:#00007F;">String</span><br /><span style="color:#00007F;">Dim</span> iPrevLastRow <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span>, iFirstRow <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span>, iNewWrkbkRow <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span></p>
<p><span style="color:#00007F;">On</span> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> FormatThisFile_Error<br /><span style="color:#007F00;">&#8216;Turn off the screen update to run the macro faster</span><br />Application.ScreenUpdating = <span style="color:#00007F;">False</span></p>
<p><span style="color:#007F00;">&#8216;Refer to the current workbook and sheet1</span><br /><span style="color:#00007F;">With</span> ThisWorkbook.Sheets(1)<br />&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;get the last row number</span><br />&#160;&#160;&#160;&#160;iLastRow = .Range(&#8220;A65536&#8243;).End(xlUp).Row<br />&#160;&#160;&#160;&#160;i = 1<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Do</span> <span style="color:#00007F;">While</span> i &lt; iLastRow<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;search for string &#8220;Structure for&#8221;</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">If</span> InStr(1, .Range(&#8220;A&#8221; &amp; i), &#8220;Structure for&#8221;) &gt; 0 <span style="color:#00007F;">Then</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;if found then store the file name</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sWrkbkNm = Trim(Right(.Range(&#8220;A&#8221; &amp; i), Len(.Range(&#8220;A&#8221; &amp; i)) &#8211; Application.WorksheetFunction.Find(&#8220;:&#8221;, .Range(&#8220;A&#8221; &amp; i))))<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sWrkbkNm = Left(sWrkbkNm, Len(sWrkbkNm) &#8211; 4)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iFirstRow = i<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;search for string &#8220;** Total **&#8221;</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">ElseIf</span> InStr(1, .Range(&#8220;A&#8221; &amp; i), &#8220;** Total **&#8221;) &gt; 0 <span style="color:#00007F;">Then</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iPrevLastRow = i<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;add a workbook</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Workbooks.Add<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;save it</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ActiveWorkbook.SaveAs ThisWorkbook.Path &amp; &#8220;\&#8221; &amp; sWrkbkNm<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sNewWrkbkNm = sWrkbkNm &amp; &#8220;.xls&#8221;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;with this new workbook do copy-paste</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">With</span> Workbooks(sNewWrkbkNm)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ThisWorkbook.Sheets(1).Range(&#8220;A&#8221; &amp; iFirstRow &amp; &#8220;:&#8221; &amp; &#8220;A&#8221; &amp; iPrevLastRow).Copy Destination:= _<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Sheets(1).Range(&#8220;A1&#8243;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iNewWrkbkRow = .Sheets(1).Range(&#8220;A65536&#8243;).End(xlUp).Row<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Sheets(1).Range(&#8220;A4:A&#8221; &amp; iNewWrkbkRow).TextToColumns Destination:= _<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Sheets(1).Range(&#8220;A4&#8243;), DataType:=xlDelimited, Space:=<span style="color:#00007F;">True</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Sheets(1).Range(&#8220;A5:A&#8221; &amp; iNewWrkbkRow &#8211; 1).Delete Shift:=xlToLeft<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Sheets(1).Columns(&#8220;A:IV&#8221;).EntireColumn.AutoFit<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Sheets(1).Columns(&#8220;A:IV&#8221;).WrapText = <span style="color:#00007F;">False</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#007F00;">&#8216;save and close this workbook</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Save<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Close<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">End</span> <span style="color:#00007F;">With</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;i = i + 1<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Loop</span><br />&#160;&#160;&#160;&#160;MsgBox &#8220;Done&#8221;<br /><span style="color:#00007F;">End</span> <span style="color:#00007F;">With</span></p>
<p><span style="color:#00007F;">On</span> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> 0<br />SmoothExit_FormatThisFile:<br />&#160;&#160;&#160;&#160;Application.ScreenUpdating = <span style="color:#00007F;">True</span><br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Exit</span> <span style="color:#00007F;">Sub</span></p>
<p>FormatThisFile_Error:<br />&#160;&#160;&#160;&#160;MsgBox &#8220;Er<br />
ror &#8221; &amp; Err.Number &amp; &#8221; (&#8221; &amp; Err.Description &amp; &#8220;) in procedure FormatThisFile&#8221;<br />&#160;&#160;&#160;&#160;<span style="color:#00007F;">Resume</span> SmoothExit_FormatThisFile</p>
<p><span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span></font></div>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2007/07/24/print-structures-of-dbf-files-in-separate-workbooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

