<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Lookup Second Occurrence</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Analyst Pulpit » Blog Archive » Vlookup Multiple Criteria in Excel</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-37873</link>
		<dc:creator>Analyst Pulpit » Blog Archive » Vlookup Multiple Criteria in Excel</dc:creator>
		<pubDate>Tue, 10 Feb 2009 21:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-37873</guid>
		<description>&lt;p&gt;[...] are other ways of looking up multiple criterias in Excel such as arrays. This is by far the easiest way of getting the job [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] are other ways of looking up multiple criterias in Excel such as arrays. This is by far the easiest way of getting the job [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DM/Diddy</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33753</link>
		<dc:creator>DM/Diddy</dc:creator>
		<pubDate>Mon, 21 Jul 2008 17:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33753</guid>
		<description>&lt;p&gt;A little aside on the Value2 property - this bit me today on a workbook that has been used by a dozen people for at least a year.&lt;/p&gt;
&lt;p&gt;Enter $0.0001 in a cell, type ?selection.value or value2 in the immediate window.  Both return 0.0001.&lt;/p&gt;
&lt;p&gt;Increase the decimal to $0.00001 and .value returns 0, while .value2 returns 0.00001.&lt;/p&gt;
&lt;p&gt;Moral of the story: always use .Value2.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>A little aside on the Value2 property &#8211; this bit me today on a workbook that has been used by a dozen people for at least a year.</p>
<p>Enter $0.0001 in a cell, type ?selection.value or value2 in the immediate window.  Both return 0.0001.</p>
<p>Increase the decimal to $0.00001 and .value returns 0, while .value2 returns 0.00001.</p>
<p>Moral of the story: always use .Value2.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33672</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Thu, 17 Jul 2008 18:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33672</guid>
		<description>&lt;p&gt;T,&lt;/p&gt;
&lt;p&gt;     Thanks very much!&lt;/p&gt;
&lt;p&gt;Brett&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>T,</p>
<p>     Thanks very much!</p>
<p>Brett</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: T</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33651</link>
		<dc:creator>T</dc:creator>
		<pubDate>Wed, 16 Jul 2008 21:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33651</guid>
		<description>&lt;p&gt;Brett, here&#039;s what I came up with that seems to work for XL 2000.  I started with CW&#039;s, didn&#039;t change it much from there, but some parts didn&#039;t work.  I&#039;m lousy in VBA, so I don&#039;t know that this is particularly lean or robust...&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Option&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Explicit&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Option&lt;/span&gt; Base 1&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; CLOOKUP(Lookup_value &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Table_array &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Col_index_num &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Optional&lt;/span&gt; vIfError &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; sAssembly &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; rFound &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; TypeName(Lookup_value) = &lt;span class=&quot;st0&quot;&gt;&quot;Range&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; sAssembly = Lookup_value.Value2&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; sAssembly = Lookup_value&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; vErrReturn &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; c1 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; c2 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; c3 &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; nrows &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Integer&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; c1 = Table_array.Columns(1)&lt;br&gt;
&#160; &#160; nrows = c1.Rows.Count&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; vArr1() &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;ReDim&lt;/span&gt; vArr1(1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; nrows, 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; 2) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; jFirstRow &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; jnextrow &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; jLastRow &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; jCurrent &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Integer&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039; set &#160;not found error&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; IsMissing(vIfError) &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; vErrReturn = CVErr(xlErrNA)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; vErrReturn = vIfError&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; NoMatch&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;find the first occurrence (unsorted Match)&lt;br&gt;
&lt;/span&gt; &#160; &#160;jFirstRow = Application.WorksheetFunction.Match(Lookup_value, c1, 0)&lt;br&gt;
&#160; &#160; vArr1(1, 1) = Table_array.Cells(jFirstRow, Col_index_num).Value&lt;br&gt;
&#160; &#160; vArr1(1, 2) = 1&lt;br&gt;
&#160; &#160; jCurrent = jFirstRow&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039; find rest of occurrences, no sorting needed?&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; X &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Integer&lt;/span&gt;&lt;br&gt;
&#160; &#160; X = 2&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Resume&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Do&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;While&lt;/span&gt; jCurrent &#160;0&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; c2 = Range(c1.Cells(jCurrent + 1, 1), c1.Cells(nrows, 1))&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; c3 = Range(c1.Cells(jCurrent + 1, 1), c1.Cells(nrows, 1).Offset(0, 1))&lt;br&gt;
&#160; &#160; &#160; &#160; jnextrow = 0&lt;br&gt;
&#160; &#160; &#160; &#160; jnextrow = Application.WorksheetFunction.Match(Lookup_value, c2, 0)&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; jnextrow = 0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; jCurrent = 0&lt;br&gt;
&#160; &#160; &#160; &#160; jCurrent = jnextrow + jCurrent&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; jCurrent &#160;0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; vArr1(X, 1) = c3.Cells(jnextrow, Col_index_num).Value&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; jCurrent &#160;0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; vArr1(X, 2) = X&lt;br&gt;
&#160; &#160; &#160; &#160; X = X + 1&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Loop&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = X - 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; 10&lt;br&gt;
&#160; &#160; &#160; &#160; vArr1(i, 1) = vErrReturn&lt;br&gt;
&#160; &#160; &#160; &#160; vArr1(i, 2) = i&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i&lt;br&gt;
&#160; &#160;&lt;br&gt;
Finish:&lt;br&gt;
&#160; &#160; CLOOKUP = vArr1&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Exit&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;br&gt;
NoMatch:&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; 10&lt;br&gt;
&#160; &#160; &#160; &#160; vArr1(i, 1) = vErrReturn&lt;br&gt;
&#160; &#160; &#160; &#160; vArr1(i, 2) = vErrReturn&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; i&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; Finish&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Brett, here&#8217;s what I came up with that seems to work for XL 2000.  I started with CW&#8217;s, didn&#8217;t change it much from there, but some parts didn&#8217;t work.  I&#8217;m lousy in VBA, so I don&#8217;t know that this is particularly lean or robust&#8230;</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Option</span> <span class="kw1">Explicit</span><br />
<span class="kw1">Option</span> Base 1<br />
<span class="kw1">Public</span> <span class="kw1">Function</span> CLOOKUP(Lookup_value <span class="kw1">As</span> <span class="kw1">Variant</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Table_array <span class="kw1">As</span> Range, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Col_index_num <span class="kw1">As</span> <span class="kw1">Long</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Optional</span> vIfError <span class="kw1">As</span> <span class="kw1">Variant</span>) <span class="kw1">As</span> <span class="kw1">Variant</span></p>
<p>&nbsp; &nbsp; <span class="kw1">Dim</span> sAssembly <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> rFound <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> i <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p>&nbsp; &nbsp; <span class="kw1">If</span> TypeName(Lookup_value) = <span class="st0">&#8220;Range&#8221;</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sAssembly = Lookup_value.Value2<br />
&nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sAssembly = Lookup_value<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span></p>
<p>&nbsp; &nbsp; <span class="kw1">Dim</span> vErrReturn <span class="kw1">As</span> <span class="kw1">Variant</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> c1 <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> c2 <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> c3 <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> nrows <span class="kw1">As</span> <span class="kw1">Integer</span><br />
&nbsp; &nbsp; <span class="kw1">Set</span> c1 = Table_array.Columns(1)<br />
&nbsp; &nbsp; nrows = c1.Rows.Count</p>
<p>&nbsp; &nbsp; <span class="kw1">Dim</span> vArr1() <span class="kw1">As</span> <span class="kw1">Variant</span><br />
&nbsp; &nbsp; <span class="kw1">ReDim</span> vArr1(1 <span class="kw1">To</span> nrows, 1 <span class="kw1">To</span> 2) <span class="kw1">As</span> <span class="kw1">Variant</span></p>
<p>&nbsp; &nbsp; <span class="kw1">Dim</span> jFirstRow <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> jnextrow <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> jLastRow <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> jCurrent <span class="kw1">As</span> <span class="kw1">Integer</span></p>
<p>&nbsp; &nbsp; <span class="co1">&#8216; set &nbsp;not found error<br />
</span> &nbsp; &nbsp;<span class="kw1">If</span> IsMissing(vIfError) <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vErrReturn = CVErr(xlErrNA)<br />
&nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vErrReturn = vIfError<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span></p>
<p>&nbsp; &nbsp; <span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> NoMatch</p>
<p>&nbsp; &nbsp; <span class="co1">&#8216;find the first occurrence (unsorted Match)<br />
</span> &nbsp; &nbsp;jFirstRow = Application.WorksheetFunction.Match(Lookup_value, c1, 0)<br />
&nbsp; &nbsp; vArr1(1, 1) = Table_array.Cells(jFirstRow, Col_index_num).Value<br />
&nbsp; &nbsp; vArr1(1, 2) = 1<br />
&nbsp; &nbsp; jCurrent = jFirstRow<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8216; find rest of occurrences, no sorting needed?<br />
</span> &nbsp; &nbsp;<span class="kw1">Dim</span> X <span class="kw1">As</span> <span class="kw1">Integer</span><br />
&nbsp; &nbsp; X = 2<br />
&nbsp; &nbsp; <span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">Resume</span> <span class="kw1">Next</span><br />
&nbsp; &nbsp; <span class="kw1">Do</span> <span class="kw1">While</span> jCurrent &nbsp;0<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Set</span> c2 = Range(c1.Cells(jCurrent + 1, 1), c1.Cells(nrows, 1))<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Set</span> c3 = Range(c1.Cells(jCurrent + 1, 1), c1.Cells(nrows, 1).Offset(0, 1))<br />
&nbsp; &nbsp; &nbsp; &nbsp; jnextrow = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; jnextrow = Application.WorksheetFunction.Match(Lookup_value, c2, 0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> jnextrow = 0 <span class="kw1">Then</span> jCurrent = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; jCurrent = jnextrow + jCurrent<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> jCurrent &nbsp;0 <span class="kw1">Then</span> vArr1(X, 1) = c3.Cells(jnextrow, Col_index_num).Value<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> jCurrent &nbsp;0 <span class="kw1">Then</span> vArr1(X, 2) = X<br />
&nbsp; &nbsp; &nbsp; &nbsp; X = X + 1<br />
&nbsp; &nbsp; <span class="kw1">Loop</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">For</span> i = X &#8211; 1 <span class="kw1">To</span> 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; vArr1(i, 1) = vErrReturn<br />
&nbsp; &nbsp; &nbsp; &nbsp; vArr1(i, 2) = i<br />
&nbsp; &nbsp; <span class="kw1">Next</span> i<br />
&nbsp; &nbsp;<br />
Finish:<br />
&nbsp; &nbsp; CLOOKUP = vArr1</p>
<p>&nbsp; &nbsp; <span class="kw1">Exit</span> <span class="kw1">Function</span><br />
NoMatch:<br />
&nbsp; &nbsp; <span class="kw1">For</span> i = 1 <span class="kw1">To</span> 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; vArr1(i, 1) = vErrReturn<br />
&nbsp; &nbsp; &nbsp; &nbsp; vArr1(i, 2) = vErrReturn<br />
&nbsp; &nbsp; <span class="kw1">Next</span> i<br />
&nbsp; &nbsp; <span class="kw1">GoTo</span> Finish</p>
<p><span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33629</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Tue, 15 Jul 2008 23:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33629</guid>
		<description>&lt;p&gt;It looks like it is a version issue.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.xtremevbtalk.com/showthread.php?p=1296419&quot; rel=&quot;nofollow&quot;&gt;http://www.xtremevbtalk.com/showthread.php?p=1296419&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Brett&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It looks like it is a version issue.</p>
<p><a href="http://www.xtremevbtalk.com/showthread.php?p=1296419" rel="nofollow">http://www.xtremevbtalk.com/showthread.php?p=1296419</a></p>
<p>Brett</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33628</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Tue, 15 Jul 2008 23:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33628</guid>
		<description>&lt;p&gt;Thanks for the ideas. The udf always returns the error, optional or default. I&#039;ll comment of what I find.&lt;/p&gt;
&lt;p&gt;Brett&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the ideas. The udf always returns the error, optional or default. I&#8217;ll comment of what I find.</p>
<p>Brett</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33624</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Tue, 15 Jul 2008 20:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33624</guid>
		<description>&lt;p&gt;IIRC, Excel 97 and 2000 just can&#039;t handle range class&#039;s Find method in a UDF. I think the Find method in those versions tried to change the active cell, which would choke a udf.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>IIRC, Excel 97 and 2000 just can&#8217;t handle range class&#8217;s Find method in a UDF. I think the Find method in those versions tried to change the active cell, which would choke a udf.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33621</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Tue, 15 Jul 2008 15:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33621</guid>
		<description>&lt;p&gt;Brett:  I haven&#039;t used 2000 in a while, so I&#039;m not sure what might be causing the problem.  Did the Find method change after 2000?  Try checking help on the Find method and see if the order of the arguments changed or something.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Brett:  I haven&#8217;t used 2000 in a while, so I&#8217;m not sure what might be causing the problem.  Did the Find method change after 2000?  Try checking help on the Find method and see if the order of the arguments changed or something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33609</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Mon, 14 Jul 2008 18:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33609</guid>
		<description>&lt;p&gt;To clarify, that was Charles Williams&#039;s code.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>To clarify, that was Charles Williams&#8217;s code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/09/lookup-second-occurrence/#comment-33608</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Mon, 14 Jul 2008 18:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1863#comment-33608</guid>
		<description>&lt;p&gt;Just read the udf more closely. Some comment needed on the code.&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; NoMatch&lt;br&gt;
:&lt;br&gt;
Finish:&lt;br&gt;
&#160; &#160; CLOOKUPS = vArr1&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Exit&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;br&gt;
NoMatch:&lt;br&gt;
&#160; &#160; vArr1 = vErrReturn&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; Finish&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Spaghetti! Why not something direct?&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; NoMatch&lt;br&gt;
:&lt;br&gt;
NoMatch:&lt;br&gt;
&#160; &#160; CLOOKUPS = IIf(Err.Number = 0, vArr1, vErrReturn)&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Just read the udf more closely. Some comment needed on the code.</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> NoMatch<br />
:<br />
Finish:<br />
&nbsp; &nbsp; CLOOKUPS = vArr1<br />
&nbsp; &nbsp; <span class="kw1">Exit</span> <span class="kw1">Function</span><br />
NoMatch:<br />
&nbsp; &nbsp; vArr1 = vErrReturn<br />
&nbsp; &nbsp; <span class="kw1">GoTo</span> Finish<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
<p>Spaghetti! Why not something direct?</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> NoMatch<br />
:<br />
NoMatch:<br />
&nbsp; &nbsp; CLOOKUPS = IIf(Err.Number = 0, vArr1, vErrReturn)<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
</channel>
</rss>

