<?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: COUNTIF Bug</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 18:06:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: MCD</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-42753</link>
		<dc:creator>MCD</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-42753</guid>
		<description>&lt;p&gt;If you want to add to the confusion try this similar RIGHT bug...&lt;br&gt;
type &quot;&#039;1234567890123456789? in A1, then run these formulas against it:&lt;br&gt;
=RIGHT(A1,10) and =TEXT(RIGHT(A1,10)&lt;br&gt;
I get &quot;0123456789? for the =RIGHT formula and&lt;br&gt;
I get &quot;123456789? for the =TEXT(RIGHT) formula&lt;/p&gt;
&lt;p&gt;To add some more confusion, add a &quot;0? to the end of the text in A1 and check the answers; they match&lt;br&gt;
Keep going - add a &quot;1? to the end of the text and they still match!&lt;br&gt;
Keep going - add &quot;2?-&quot;9? and when you reach &quot;9?, they don&#039;t match again!&lt;/p&gt;
&lt;p&gt;Those darn 9&#039;s!!!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you want to add to the confusion try this similar RIGHT bug&#8230;<br />
type &#8220;&#8217;1234567890123456789? in A1, then run these formulas against it:<br />
=RIGHT(A1,10) and =TEXT(RIGHT(A1,10)<br />
I get &#8220;0123456789? for the =RIGHT formula and<br />
I get &#8220;123456789? for the =TEXT(RIGHT) formula</p>
<p>To add some more confusion, add a &#8220;0? to the end of the text in A1 and check the answers; they match<br />
Keep going &#8211; add a &#8220;1? to the end of the text and they still match!<br />
Keep going &#8211; add &#8220;2?-&#8221;9? and when you reach &#8220;9?, they don&#8217;t match again!</p>
<p>Those darn 9&#8242;s!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MCD</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-42723</link>
		<dc:creator>MCD</dc:creator>
		<pubDate>Thu, 10 Dec 2009 19:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-42723</guid>
		<description>&lt;p&gt;This returns 3 as well:&lt;br&gt;
=COUNTIF(A1:A3,CONCATENATE(TEXT(LEFT($A$1,15),&quot;0?),TEXT(RIGHT($A$1,3),&quot;0?)))&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This returns 3 as well:<br />
=COUNTIF(A1:A3,CONCATENATE(TEXT(LEFT($A$1,15),&#8221;0?),TEXT(RIGHT($A$1,3),&#8221;0?)))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: talay.pr</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-42716</link>
		<dc:creator>talay.pr</dc:creator>
		<pubDate>Thu, 10 Dec 2009 09:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-42716</guid>
		<description>&lt;p&gt;my condition have 19 digit  , it error too .&lt;br&gt;
I use data &gt; consolidate to slove my FS problem.&lt;br&gt;
Thanks infos.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>my condition have 19 digit  , it error too .<br />
I use data &gt; consolidate to slove my FS problem.<br />
Thanks infos.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cosh</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-37975</link>
		<dc:creator>Cosh</dc:creator>
		<pubDate>Mon, 16 Feb 2009 02:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-37975</guid>
		<description>&lt;p&gt;Excel is a good tool for performing basic addition and subtraction, and occasionally multiplication and division. For complex engineering problems, cancer research, and science problems, I would not use Excel. The results are simply untrustworthy and highly unstable.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Excel is a good tool for performing basic addition and subtraction, and occasionally multiplication and division. For complex engineering problems, cancer research, and science problems, I would not use Excel. The results are simply untrustworthy and highly unstable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heles Eugene</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-32588</link>
		<dc:creator>Heles Eugene</dc:creator>
		<pubDate>Thu, 29 May 2008 14:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-32588</guid>
		<description>&lt;p&gt;Hi,&lt;br&gt;
 referring to »countif bug»&lt;br&gt;
Enter this formula in B1:&lt;/p&gt;
&lt;p&gt;=COUNTIF(A1:A3,A1)  I agree returns 3 ?? why don&#039;t know&lt;br&gt;
but if countif(a1:A1,A3) you get »your» 1&lt;br&gt;
see you online&lt;br&gt;
regards&lt;br&gt;
Eugène&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi,<br />
 referring to »countif bug»<br />
Enter this formula in B1:</p>
<p>=COUNTIF(A1:A3,A1)  I agree returns 3 ?? why don&#8217;t know<br />
but if countif(a1:A1,A3) you get »your» 1<br />
see you online<br />
regards<br />
Eugène</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-29208</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 06 Dec 2007 03:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-29208</guid>
		<description>&lt;p&gt;Gianni -&lt;/p&gt;
&lt;p&gt;&quot;maybe in order to lower its memory usage&quot;&lt;/p&gt;
&lt;p&gt;More likely an assumption that if something in a spreadsheet looks like a number, you want to treat it in a calculation as a number.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Gianni -</p>
<p>&#8220;maybe in order to lower its memory usage&#8221;</p>
<p>More likely an assumption that if something in a spreadsheet looks like a number, you want to treat it in a calculation as a number.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gianni G</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-29181</link>
		<dc:creator>Gianni G</dc:creator>
		<pubDate>Tue, 04 Dec 2007 23:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-29181</guid>
		<description>&lt;p&gt;It seems that excel converts text strings that contain only numbers into number format before doing any calculations, maybe in order to lower its memory usage...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It seems that excel converts text strings that contain only numbers into number format before doing any calculations, maybe in order to lower its memory usage&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-21328</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Mon, 23 Oct 2006 22:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-21328</guid>
		<description>&lt;p&gt;I get 3 using Excel 2003 SP1.&lt;/p&gt;
&lt;p&gt;This is just how COUNTIF works. It&#039;s second argument is ALWAYS treated as a string, even when it&#039;s entered as a number. That&#039;s why it didn&#039;t matter whether its second argument was a reference to A1 or the text value of A1.&lt;/p&gt;
&lt;p&gt;This functionality leads to ambiguity. When COUNTIF&#039;s second argument is a number, it matches both numbers AND text strings in its first argument range that have the same text representation. Enter 1 as a number in D1, =&quot;1? in D2 and leave D3 blank. The formulas&lt;/p&gt;
&lt;p&gt;=COUNTIF(D1:D3,1)&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;=COUNTIF(D1:D3,&quot;1?)&lt;/p&gt;
&lt;p&gt;both return 2 while the formulas&lt;/p&gt;
&lt;p&gt;=SUMPRODUCT((D1:D3=1))&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;=SUMPRODUCT((D1:D3=&quot;1?))&lt;/p&gt;
&lt;p&gt;both return 1. Since =1=&quot;1? returns FALSE, it&#039;s COUNTIF that provides unusual functionality.&lt;/p&gt;
&lt;p&gt;With the original 18-digit strings in A1:A3, COUNTIF&#039;s second argument is interpretted as a string, but since that argument looks like a number, COUNTIF proceeds to interpret it as a number, and that&#039;s the point at which it&#039;s munged into 15 decimal digits of precision. It does the same thing for the values in A1:A3, converting them to numbers, thus ignoring their last 3 digits.&lt;/p&gt;
&lt;p&gt;There&#039;s an imperfect work-around: force Excel to treat these values as text by using&lt;/p&gt;
&lt;p&gt;=COUNTIF(A1:A3,A1&amp;&quot;*&quot;)-COUNTIF(A1:A3,A1&amp;&quot;?*&quot;)&lt;/p&gt;
&lt;p&gt;which forces COUNTIF to treat all cells in A1:A3 as text, and the second COUNTIF call reduces the count for any cells in A2:A3 that contained A1 as a proper leading substring.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I get 3 using Excel 2003 SP1.</p>
<p>This is just how COUNTIF works. It&#8217;s second argument is ALWAYS treated as a string, even when it&#8217;s entered as a number. That&#8217;s why it didn&#8217;t matter whether its second argument was a reference to A1 or the text value of A1.</p>
<p>This functionality leads to ambiguity. When COUNTIF&#8217;s second argument is a number, it matches both numbers AND text strings in its first argument range that have the same text representation. Enter 1 as a number in D1, =&#8221;1? in D2 and leave D3 blank. The formulas</p>
<p>=COUNTIF(D1:D3,1)</p>
<p>and</p>
<p>=COUNTIF(D1:D3,&#8221;1?)</p>
<p>both return 2 while the formulas</p>
<p>=SUMPRODUCT((D1:D3=1))</p>
<p>and</p>
<p>=SUMPRODUCT((D1:D3=&#8221;1?))</p>
<p>both return 1. Since =1=&#8221;1? returns FALSE, it&#8217;s COUNTIF that provides unusual functionality.</p>
<p>With the original 18-digit strings in A1:A3, COUNTIF&#8217;s second argument is interpretted as a string, but since that argument looks like a number, COUNTIF proceeds to interpret it as a number, and that&#8217;s the point at which it&#8217;s munged into 15 decimal digits of precision. It does the same thing for the values in A1:A3, converting them to numbers, thus ignoring their last 3 digits.</p>
<p>There&#8217;s an imperfect work-around: force Excel to treat these values as text by using</p>
<p>=COUNTIF(A1:A3,A1&amp;&#8221;*&#8221;)-COUNTIF(A1:A3,A1&amp;&#8221;?*&#8221;)</p>
<p>which forces COUNTIF to treat all cells in A1:A3 as text, and the second COUNTIF call reduces the count for any cells in A2:A3 that contained A1 as a proper leading substring.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TKT-Tang</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-21245</link>
		<dc:creator>TKT-Tang</dc:creator>
		<pubDate>Thu, 12 Oct 2006 10:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-21245</guid>
		<description>&lt;p&gt;1. Countif() has a mind of its own amidst many other things.&lt;/p&gt;
&lt;p&gt;2. May force the numeric string to text by, =&quot;123456789012345111? ; and yet, Countif takes that to be a number still, 1.23456789^+17 (Excel-2000, server version).&lt;/p&gt;
&lt;p&gt;3. At long last, the numeric string may be cast in the stone of text by,&lt;br&gt;
=Char(28 to 31)&amp;&quot;123456789012345111? or =Char(160)&amp;&quot;123456789012345111? (amongst other possibilities ?!).&lt;/p&gt;
&lt;p&gt;4. Regards.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>1. Countif() has a mind of its own amidst many other things.</p>
<p>2. May force the numeric string to text by, =&#8221;123456789012345111? ; and yet, Countif takes that to be a number still, 1.23456789^+17 (Excel-2000, server version).</p>
<p>3. At long last, the numeric string may be cast in the stone of text by,<br />
=Char(28 to 31)&amp;&#8221;123456789012345111? or =Char(160)&amp;&#8221;123456789012345111? (amongst other possibilities ?!).</p>
<p>4. Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul B</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/10/10/countif-bug/#comment-21240</link>
		<dc:creator>Paul B</dc:creator>
		<pubDate>Thu, 12 Oct 2006 04:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1526#comment-21240</guid>
		<description>&lt;p&gt;John, I also get the right answer using Excel 2002(10.6501.6626) SP3&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>John, I also get the right answer using Excel 2002(10.6501.6626) SP3</p>
]]></content:encoded>
	</item>
</channel>
</rss>

