Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default simple counting gone awry

I'm trying to count the number of occurances in a range based on the
value in the cell.

for example:
a1 has 0.001
a2 has 0.020
...and so on.

I've tried using =countif(myrange,"=a1"), but I get 0 in return. When
I know my range has 0.001 in it.

what the heck am I doing wrong?

Excel 2007
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default simple counting gone awry

Try it like this:

=countif(myrange,a1)

The way you had it the formula was looking for the literal string
"a1", rather than the contents of A1. The = is implied, and so not
needed.

Hope this helps.

Pete

On Nov 10, 12:04*am, Nondisclosure007
wrote:
I'm trying to count the number of occurances in a range based on the
value in the cell.

for example:
a1 has 0.001
a2 has 0.020
..and so on.

I've tried using =countif(myrange,"=a1"), but I get 0 in return. *When
I know my range has 0.001 in it.

what the heck am I doing wrong?

Excel 2007


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default simple counting gone awry

=COUNTIF(range,A1) works for me as long as you don't have a rounding
problem.


Gord Dibben MS Excel MVP

On Mon, 9 Nov 2009 16:04:10 -0800 (PST), Nondisclosure007
wrote:

I'm trying to count the number of occurances in a range based on the
value in the cell.

for example:
a1 has 0.001
a2 has 0.020
..and so on.

I've tried using =countif(myrange,"=a1"), but I get 0 in return. When
I know my range has 0.001 in it.

what the heck am I doing wrong?

Excel 2007


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default simple counting gone awry

"Nondisclosure007" wrote:
I've tried using =countif(myrange,"=a1"), but I get 0
in return. When I know my range has 0.001 in it.
what the heck am I doing wrong?


For one thing, you should write COUNTIF(myrange,"="&A1), although
COUNTIF(myrange,A1) would suffice in this case because "=" is implicit.

But even so, COUNTIF might return some suprising result because not all
values that display as 0.001 are equal.

Perhaps the following will work more reliably for you:

=SUMPRODUCT(--(ROUND(myrange,3)=ROUND(A1,3)))

Change the 3 to 4 or something larger if your intent is to distinguish
0.0011 from 0.0010, for example.


----- original message -----

"Nondisclosure007" wrote in message
...
I'm trying to count the number of occurances in a range based on the
value in the cell.

for example:
a1 has 0.001
a2 has 0.020
..and so on.

I've tried using =countif(myrange,"=a1"), but I get 0 in return. When
I know my range has 0.001 in it.

what the heck am I doing wrong?

Excel 2007


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
Formula gone awry Connie Martin Excel Worksheet Functions 11 November 13th 08 02:16 AM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
simple, counting the last character in text JVANWORTH Excel Worksheet Functions 7 July 13th 07 07:33 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM


All times are GMT +1. The time now is 11:05 PM.

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"