#1   Report Post  
Posted to microsoft.public.excel.misc
daydreamin7
 
Posts: n/a
Default Counting problem

I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?
--
Thanks,
~Laura~
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default Counting problem

Do you have any numbers < 0 (negative)?
if not,
=IF(ISNA(MATCH(0,A2:A999,0),ROWS(A2:A999),MATCH(0, A2:A999))
will return the count of non-zero numbers before you hit 0 or end-of-list.

HTH
--
AP

"daydreamin7" a écrit dans le
message de ...
I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?
--
Thanks,
~Laura~



  #3   Report Post  
Posted to microsoft.public.excel.misc
daydreamin7
 
Posts: n/a
Default Counting problem

I don't have any negative numbers, but sometimes when I hit F9 to randomize,
it shows N/A and says it has a problem calculating the MATCH part of the
function. Any ideas?
--
~Laura~


"Ardus Petus" wrote:

Do you have any numbers < 0 (negative)?
if not,
=IF(ISNA(MATCH(0,A2:A999,0),ROWS(A2:A999),MATCH(0, A2:A999))
will return the count of non-zero numbers before you hit 0 or end-of-list.

HTH
--
AP

"daydreamin7" a écrit dans le
message de ...
I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?
--
Thanks,
~Laura~




  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Counting problem

=IF(MIN(IF((A1:A20=0)*(A1:A20<""),ROW(A1:A20)))=0 ,ROWS(A1:A20),MIN(IF((A1:A
20=0)*(A1:A20<""),ROW(A1:A20))))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"daydreamin7" wrote in message
...
I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?
--
Thanks,
~Laura~



  #5   Report Post  
Posted to microsoft.public.excel.misc
daydreamin7
 
Posts: n/a
Default Counting problem

This formula won't change when I hit F9 to randomize it. I need the formula
to work when I change the numbers.
--
~Laura~


"Bob Phillips" wrote:

=IF(MIN(IF((A1:A20=0)*(A1:A20<""),ROW(A1:A20)))=0 ,ROWS(A1:A20),MIN(IF((A1:A
20=0)*(A1:A20<""),ROW(A1:A20))))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"daydreamin7" wrote in message
...
I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?
--
Thanks,
~Laura~






  #6   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Counting problem

It changes fine for me. Did you array enter it?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"daydreamin7" wrote in message
...
This formula won't change when I hit F9 to randomize it. I need the

formula
to work when I change the numbers.
--
~Laura~


"Bob Phillips" wrote:


=IF(MIN(IF((A1:A20=0)*(A1:A20<""),ROW(A1:A20)))=0 ,ROWS(A1:A20),MIN(IF((A1:A
20=0)*(A1:A20<""),ROW(A1:A20))))

which is an array formula, it should be committed with Ctrl-Shift-Enter,

not
just Enter.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"daydreamin7" wrote in message
...
I am trying to find a way to count cells in a range, I want them to

count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over

for
the simulation I'm dong. Any ideas what I can do?
--
Thanks,
~Laura~






  #7   Report Post  
Posted to microsoft.public.excel.misc
Domenic
 
Posts: n/a
Default Counting problem

Assuming that A2:A100 contains your numbers, try...

=IF(COUNTIF(A2:A100,0),COUNTIF(A2:INDEX(A2:A100,MA TCH(0,A2:A100,0)),"0")
,COUNTIF(A2:A100,"0"))

Hope this helps!

In article ,
"daydreamin7" wrote:

I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?

  #8   Report Post  
Posted to microsoft.public.excel.misc
daydreamin7
 
Posts: n/a
Default Counting problem

Yes! that did it! thank you so much, you just saved my operations management
grade! :)
--
~Laura~


"Domenic" wrote:

Assuming that A2:A100 contains your numbers, try...

=IF(COUNTIF(A2:A100,0),COUNTIF(A2:INDEX(A2:A100,MA TCH(0,A2:A100,0)),"0")
,COUNTIF(A2:A100,"0"))

Hope this helps!

In article ,
"daydreamin7" wrote:

I am trying to find a way to count cells in a range, I want them to count
numbers greater than 0. But when I hit the first 0 (I have it on
randomization), I want it to stop counting... because the game is over for
the simulation I'm dong. Any ideas what I can do?


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
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Problem with counting characters in a cell Tink Excel Worksheet Functions 2 June 27th 05 12:52 PM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
problem office assistant R.VENKATARAMAN Excel Discussion (Misc queries) 0 June 15th 05 06:22 AM
problem adding rvnwdr Excel Discussion (Misc queries) 2 June 8th 05 06:36 PM


All times are GMT +1. The time now is 06:51 PM.

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

About Us

"It's about Microsoft Excel"