Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Counting number of consecutive zeros at the end of a list

I have a column of numbers like this:

5
7
0
5
0
0
Empty Cell
Empty Cell

And I want to count the number of consecutive zeros at the end of the
list ignoring any blank cells. In the above example the result would
be "2" - two consecutive zeros and the two blank cells are ignored.
Thanks for any help you can provide.

if the last non-blank cell is any value except zero then the result
shound be "0".

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Try this

=MAX((A2:A20<"")*(ROW(A2:A20)))-MAX((A2:A20<0)*(A2:A20<"")*(ROW(A2:A20)))

it is an array formula, so commit with Ctrl-Shift-Enter.

--
HTH

Bob Phillips

wrote in message
oups.com...
I have a column of numbers like this:

5
7
0
5
0
0
Empty Cell
Empty Cell

And I want to count the number of consecutive zeros at the end of the
list ignoring any blank cells. In the above example the result would
be "2" - two consecutive zeros and the two blank cells are ignored.
Thanks for any help you can provide.

if the last non-blank cell is any value except zero then the result
shound be "0".



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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
Counting number of occurrences LyleB_Austin Excel Worksheet Functions 1 September 15th 05 10:42 PM
Counting the total number of cells with specified condition(freque Kelvin Excel Discussion (Misc queries) 2 July 10th 05 12:22 PM
Counting number of grades in a row Marie1uk Excel Worksheet Functions 13 July 6th 05 12:56 PM
counting number of particular items in a list vikkam Excel Discussion (Misc queries) 8 July 5th 05 08:35 AM


All times are GMT +1. The time now is 05:49 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"