Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default COUNTIF provides weird results

Hi,

I had never expected the result that comes out from this example:
Excel cannot mix text and figures in 1 single list of values. Her
comes what happens:

My model contains, in A1 to A6 the values

1
2
3
a
b
c

In B1 I input COUNTIF($A$1:$A$6,"<="&$A$1:$A$6) and I copy it down to
B6. I get:

1
2
3
1
2
3

instead of

1
2
3
4
5
6

My question: why if 1 and 2 and 3 are smaller than "a", the count of
values smaller than or equal to "a" returns 1 and not 4. I cannot
understand it.

Does anybody have any suggestions?

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default COUNTIF provides weird results

wrote...
....
My model contains, in A1 to A6 the values

1
2
3
a
b
c

In B1 I input COUNTIF($A$1:$A$6,"<="&$A$1:$A$6) and I copy it down
to B6. I get:

1
2
3
1
2
3

instead of

1
2
3
4
5
6

My question: why if 1 and 2 and 3 are smaller than "a", the count of
values smaller than or equal to "a" returns 1 and not 4. I cannot
understand it.

....

Microsoft built extra intelligence into COUNTIF and SUMIF. When it
comes to matching error values, it can be handy. Unfortunately, it
follows its own logic when it comes to comparing text to numbers. If
you want the result above, don't use COUNTIF. Use separate formulas

=SUMPRODUCT(--($A$1:$A$6<=A1))
=SUMPRODUCT(--($A$1:$A$6<=A2))
=SUMPRODUCT(--($A$1:$A$6<=A3))
=SUMPRODUCT(--($A$1:$A$6<=A4))
=SUMPRODUCT(--($A$1:$A$6<=A5))
=SUMPRODUCT(--($A$1:$A$6<=A6))

Is there a good reason Excel handles <= comparisons differently in
COUNTIF/SUMIF criteria arguments vs elsewhere? No. COUNTIF/SUMIF are
poorly documented, and it'd surprise me if any of the

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default COUNTIF provides weird results

Thank you Harlan,

However, sumproduct does not seem to work differently than countif !!!

I get the same results

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default COUNTIF provides weird results

On Feb 10, 9:50 am, wrote:

Sorry, it works perfectly.

Thank you

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
And/Or Results - Ron/Excelent Shu of AZ Excel Discussion (Misc queries) 2 October 15th 06 06:23 PM
COUNTIF with pivot table results? [email protected] Excel Worksheet Functions 0 September 7th 06 06:24 PM
autofilter does not hide unwanted results rewrites Excel Worksheet Functions 1 August 19th 06 03:52 PM
CountIf formula results in the formula itself being displayed. NewKid Excel Worksheet Functions 9 December 21st 05 11:10 PM
calculating results in formulas Linda Excel Discussion (Misc queries) 9 July 6th 05 09:20 AM


All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"