#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default array question

Hi all...I hope someone can help me here, I have a single array column just
over 100 long which is filled with noughts and ones and I would like to
count how many
noughts there are between each number of ones. The answer could be EG
5,8,3,9,2,4 which
tells me there is six gaps and the number of noughts in each gap.
thanks for any help
Len


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default array question

Try this:

Assume the data starts in cell A1.

Enter this formula in B1:

=IF(AND(A1=0,A2=1),1,"")

Enter this formula in B2 and copy down to the end of data in column A. I'm
assuming there is an empty cell at the end of data in column A.

=IF(A2=1,"",IF(OR(A3=1,A3=""),COUNTIF(A$1:A2,0)-SUM(B$1:B1),""))

--
Biff
Microsoft Excel MVP


"Len Case" wrote in message
...
Hi all...I hope someone can help me here, I have a single array column
just
over 100 long which is filled with noughts and ones and I would like to
count how many
noughts there are between each number of ones. The answer could be EG
5,8,3,9,2,4 which
tells me there is six gaps and the number of noughts in each gap.
thanks for any help
Len




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default array question

Thankyou very much it did the trick great
thanks from Len


"T. Valko" wrote in message
...
Try this:

Assume the data starts in cell A1.

Enter this formula in B1:

=IF(AND(A1=0,A2=1),1,"")

Enter this formula in B2 and copy down to the end of data in column A. I'm
assuming there is an empty cell at the end of data in column A.

=IF(A2=1,"",IF(OR(A3=1,A3=""),COUNTIF(A$1:A2,0)-SUM(B$1:B1),""))

--
Biff
Microsoft Excel MVP


"Len Case" wrote in message
...
Hi all...I hope someone can help me here, I have a single array column
just
over 100 long which is filled with noughts and ones and I would like to
count how many
noughts there are between each number of ones. The answer could be EG
5,8,3,9,2,4 which
tells me there is six gaps and the number of noughts in each gap.
thanks for any help
Len






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default array question

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Len Case" wrote in message
...
Thankyou very much it did the trick great
thanks from Len


"T. Valko" wrote in message
...
Try this:

Assume the data starts in cell A1.

Enter this formula in B1:

=IF(AND(A1=0,A2=1),1,"")

Enter this formula in B2 and copy down to the end of data in column A.
I'm assuming there is an empty cell at the end of data in column A.

=IF(A2=1,"",IF(OR(A3=1,A3=""),COUNTIF(A$1:A2,0)-SUM(B$1:B1),""))

--
Biff
Microsoft Excel MVP


"Len Case" wrote in message
...
Hi all...I hope someone can help me here, I have a single array column
just
over 100 long which is filled with noughts and ones and I would like to
count how many
noughts there are between each number of ones. The answer could be EG
5,8,3,9,2,4 which
tells me there is six gaps and the number of noughts in each gap.
thanks for any help
Len








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
Index array question LJoe Excel Worksheet Functions 2 August 27th 07 02:14 PM
another array question Robert Dieckmann Excel Worksheet Functions 5 January 20th 07 02:08 AM
Array Question keeblerjp Excel Discussion (Misc queries) 4 June 20th 06 04:21 PM
Matrix/array question cursednomore Excel Discussion (Misc queries) 0 November 9th 05 08:09 PM
Array Question Renee Excel Worksheet Functions 0 June 29th 05 07:10 PM


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