<?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; excel functions</title>
	<atom:link href="http://nandeshwar.info/tag/excel-functions/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>Count Text in a Range</title>
		<link>http://nandeshwar.info/2009/04/24/count-text-in-a-range/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=count-text-in-a-range</link>
		<comments>http://nandeshwar.info/2009/04/24/count-text-in-a-range/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 14:21:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Operations]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[excel functions]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[wildcard]]></category>

		<guid isPermaLink="false">http://nandeshwar.info/?p=191</guid>
		<description><![CDATA[Counting text in a range is easy. For example, if you would like count how many times &#8220;text&#8221; is in a specified range (named data), you can write something like this: =COUNTIF(data,"*text*") This formula will give you the count of all the cells where Excel found &#8220;text&#8221; at any place. But let&#8217;s say you want [...]]]></description>
			<content:encoded><![CDATA[<p>Counting text in a range is easy. For example, if you would like count how many times &#8220;text&#8221; is in a specified range (named data), you can write something like this:<br />
<code>=COUNTIF(data,"*text*")</code></p>
<p>This formula will give you the count of all the cells where Excel found &#8220;text&#8221; at any place.</p>
<p>But let&#8217;s say you want to count wildcard characters in a range, then you can write something like this:<br />
<code>=SUM(IF(NOT(ISERR(FIND("*",data))),1,0))</code></p>
<p>This formula should be entered as an array formula with Ctrl + Shift + Enter. Usually, wildcard can be &#8220;escaped&#8221; using a tilde (~), but the <code>FIND</code> function doesn&#8217;t understand wildcard characters like the <code>SEARCH</code> function does.</p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2009/04/24/count-text-in-a-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Specific number of zeros to a value</title>
		<link>http://nandeshwar.info/2006/02/08/add-specific-number-of-zeros-to-a-value/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-specific-number-of-zeros-to-a-value</link>
		<comments>http://nandeshwar.info/2006/02/08/add-specific-number-of-zeros-to-a-value/#comments</comments>
		<pubDate>Wed, 08 Feb 2006 19:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Operations]]></category>
		<category><![CDATA[excel functions]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2006/02/08/add-specific-number-of-zeros-to-a-value/</guid>
		<description><![CDATA[This is one of the finest forumlae I&#8217;ve ever seen. Check this post at MrExcel. If you want to have a value specific number of digits otherwise add zeros in front of it, this formula could be used: =TEXT(A1,REPT(&#8220;0&#8243;,n)) where n is the number of digits you want. So 4555 becomes 000004555 with formula =TEXT(4555,REPT(&#8220;0&#8243;,9))]]></description>
			<content:encoded><![CDATA[<p>This is one of the finest forumlae I&#8217;ve ever seen. Check this <a href="http://www.mrexcel.com/board2/viewtopic.php?t=193924">post</a> at MrExcel.</p>
<p>If you want to have a value specific number of digits otherwise add zeros in front of it, this formula could be used:<br />
=TEXT(A1,REPT(&#8220;0&#8243;,<em>n</em>))<br />
where n is the number of digits you want.</p>
<p>So 4555 becomes 000004555 with formula =TEXT(4555,REPT(&#8220;0&#8243;,9))</p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2006/02/08/add-specific-number-of-zeros-to-a-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Numbers</title>
		<link>http://nandeshwar.info/2006/01/21/random-numbers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=random-numbers</link>
		<comments>http://nandeshwar.info/2006/01/21/random-numbers/#comments</comments>
		<pubDate>Sat, 21 Jan 2006 17:59:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useful Procedures]]></category>
		<category><![CDATA[excel functions]]></category>
		<category><![CDATA[random numbers]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2006/01/21/random-numbers/</guid>
		<description><![CDATA[Recently, I had the need of generating different types of random numbers. Although, Excel&#8217;s Data Analysis Toolpak can generate good random numbers, I had to create these functions to meet my needs. First: Unique Random Numbers This function was modified from ozgrid&#8217;s RandLotto function, which returns string. This function will return an array of unqiue [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I had the need of generating different types of random numbers. Although, Excel&#8217;s Data Analysis Toolpak can generate good random numbers, I had to create these functions to meet my needs.</p>
<p>First: Unique Random Numbers<br />
This function was modified from ozgrid&#8217;s RandLotto function, which returns string. This function will return an array of unqiue random integers in the given range. If you want to return more than one number then this function should be entered as an array formula with Ctrl + Shift + Enter.</p>
<div id="code"><span style="font-family: Courier;"><span style="color:#00007F;">Function</span> UniqueRand(lngSmallest <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, lngHighest <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, HowManyNos <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>) <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>()<br />
<span style="color:#007F00;">&#8216;modified from http://www.ozgrid.com/VBA/RandomNumbers.htm</span><br />
<span style="color:#00007F;">Dim</span> iArr <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span><br />
<span style="color:#00007F;">Dim</span> i <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span><br />
<span style="color:#00007F;">Dim</span> r <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span><br />
<span style="color:#00007F;">Dim</span> temp <span style="color:#00007F;">As</span> <span style="color:#00007F;">Integer</span><br />
Application.Volatile<br />
<span style="color:#00007F;">ReDim</span> iArr(lngSmallest <span style="color:#00007F;">To</span> lngHighest)<br />
<span style="color:#00007F;">For</span> i = lngSmallest <span style="color:#00007F;">To</span> lngHighest<br />
iArr(i) = i<br />
<span style="color:#00007F;">Next</span> i<br />
<span style="color:#00007F;">For</span> i = lngHighest <span style="color:#00007F;">To</span> lngSmallest + 1 <span style="color:#00007F;">Step</span> -1<br />
r = Int(Rnd() * (i &#8211; lngSmallest + 1)) + lngSmallest<br />
temp = iArr(r)<br />
iArr(r) = iArr(i)<br />
iArr(i) = temp<br />
<span style="color:#00007F;">Next</span> i<br />
<span style="color:#00007F;">Dim</span> resultArr() <span style="color:#00007F;">As</span> Long: <span style="color:#00007F;">ReDim</span> resultArr(HowManyNos &#8211; 1, 0)<br />
<span style="color:#00007F;">For</span> i = lngSmallest <span style="color:#00007F;">To</span> lngSmallest + HowManyNos &#8211; 1<br />
resultArr(j, 0) = iArr(i)<br />
j = j + 1<br />
<span style="color:#00007F;">Next</span> i<br />
UniqueRand = resultArr<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Function</span></span></div>
<p>Second: Gaussian or Normal Random Numbers with specified mean and Standard deviation(SD). Now, this function is different than the Analysis toolpak utility because it generates random numbers on a fixed mean and Standard deviation. This function will allow the user to generate random numbers each with different mean and SD.</p>
<div id="code"><span style="font-family: Courier;"><span style="color:#007F00;">&#8216;This function will generate Gaussian or Normal Random Numbers based on given mean and SD</span><br />
<span style="color:#00007F;">Public</span> <span style="color:#00007F;">Function</span> GenGaussNoise(mean <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span>, SD <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span>, HowMany <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>) <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span>()<br />
<span style="color:#00007F;">Dim</span> x <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span>, i <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, j <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span><br />
itr = 50<br />
<span style="color:#00007F;">Dim</span> dblResArr() <span style="color:#00007F;">As</span> Double: <span style="color:#00007F;">ReDim</span> dblResArr(HowMany &#8211; 1, 0)<br />
<span style="color:#00007F;">For</span> j = 1 <span style="color:#00007F;">To</span> HowMany<br />
x = 0<br />
<span style="color:#00007F;">For</span> i = 1 <span style="color:#00007F;">To</span> itr<br />
Randomize<br />
U = Rnd<br />
x = x + U<br />
<span style="color:#00007F;">Next</span> i<br />
<span style="color:#007F00;">&#8216; /* for uniform randoms in [0,1], mu = 0.5 and var = 1/12 */</span><br />
<span style="color:#007F00;">&#8216; /* adjust X so mu = 0 and var = 1 */</span><br />
x = x &#8211; itr / 2             <span style="color:#007F00;">&#8216; /* set mean to 0 */</span><br />
x = x * Sqr(12 / itr)     <span style="color:#007F00;">&#8216;  /* adjust variance to 1 */</span><br />
dblResArr(j &#8211; 1, 0) = mean + SD * x<br />
<span style="color:#00007F;">Next</span> j<br />
GenGaussNoise = dblResArr<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Function</span></span></div>
<p>Third: Generate white noise or Guassian or Normal random numbers with mean = 0 and SD =1. Although, this could be achieved by the previous function, this function uses Box-Muller method. In this function too, you can use different mean and SD, although if not provided it would take mean =0 and SD=1</p>
<div id="code"><span style="font-family: Courier;"><span style="color:#00007F;">Public</span> <span style="color:#00007F;">Function</span> GenWhiteNoise(HowMany <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, <span style="color:#00007F;">Optional</span> mean <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span> = 0, <span style="color:#00007F;">Optional</span> variance <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span> = 1) <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span>()<br />
<span style="color:#007F00;">&#8216;Returns a normally distributed random variate with mean 0 and variance 1, a.k.a. &#8220;White Noise&#8221;.</span><br />
<span style="color:#007F00;">&#8216;  Uses the Box-Muller method</span><br />
<span style="color:#00007F;">Dim</span> Value1 <span style="color:#00007F;">As</span> <span style="color:#00007F;">Single</span>, Value2 <span style="color:#00007F;">As</span> <span style="color:#00007F;">Single</span>, Fac <span style="color:#00007F;">As</span> <span style="color:#00007F;">Single</span>, Rsq <span style="color:#00007F;">As</span> <span style="color:#00007F;">Single</span>, SD <span style="color:#00007F;">As</span> <span style="color:#00007F;">Double</span><br />
<span style="color:#00007F;">Dim</span> dblResArr() <span style="color:#00007F;">As</span> Double: <span style="color:#00007F;">ReDim</span> dblResArr(HowMany &#8211; 1, 0)<br />
SD = Sqr(variance)<br />
<span style="color:#00007F;">For<br />
pan&gt; i = 1 <span style="color:#00007F;">To</span> HowMany<br />
<span style="color:#00007F;">Do</span><br />
Randomize<br />
Value1 = 2 * Rnd &#8211; 1<br />
Value2 = 2 * Rnd &#8211; 1<br />
Rsq = Value1 ^ 2 + Value2 ^ 2<br />
<span style="color:#00007F;">Loop</span> <span style="color:#00007F;">Until</span> Rsq &gt; 0 And Rsq &lt; 1<br />
Fac = (-2 * Log(Rsq) / Rsq) ^ 0.5<br />
<span style="color:#00007F;">If</span> Rnd &lt; 0.5 <span style="color:#00007F;">Then</span><br />
dblResArr(i &#8211; 1, 0) = mean + SD * Value1 * Fac<br />
<span style="color:#00007F;">Else</span><br />
dblResArr(i &#8211; 1, 0) = mean + SD * Value2 * Fac<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span><br />
<span style="color:#00007F;">Next</span> i<br />
GenWhiteNoise = dblResArr<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Function</span></span></span></div>
<p>This is a screenshot of the Excel file. Also, the original Excel file can be downloaded <a href="http://www.nandeshwar.info/projects/xlblog/files/AllTypeofRandomNos.xls">here</a>.<br />
<a href="http://www.nandeshwar.info/projects/xlblog/uploaded_images/RandomNumbers-715877.JPG"><img style="display:block;text-align:center;cursor:hand;margin:0 auto 10px;" src="http://www.nandeshwar.info/projects/xlblog/uploaded_images/RandomNumbers-708779.JPG" border="0" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2006/01/21/random-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Count number of asterisk (*)</title>
		<link>http://nandeshwar.info/2005/02/10/count-number-of-asterisk/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=count-number-of-asterisk</link>
		<comments>http://nandeshwar.info/2005/02/10/count-number-of-asterisk/#comments</comments>
		<pubDate>Thu, 10 Feb 2005 01:32:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Operations]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[excel functions]]></category>
		<category><![CDATA[wildcard]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2005/02/10/count-number-of-asterix/</guid>
		<description><![CDATA[To count number of asterisk (*) in a column use this formula: =COUNTIF(A1:A3, "=~*")]]></description>
			<content:encoded><![CDATA[<p>To count number of asterisk (*) in a column use this formula:<br />
<code>=COUNTIF(A1:A3, "=~*")</code></p>
]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2005/02/10/count-number-of-asterisk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

