View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sam via OfficeKB.com
 
Posts: n/a
Default Count Intervals of 2 Consecutive Values in same Row and Return Count across Row

Hi Domenic,

Thank you for reply. I'm receiving #Value error - not sure Why?

Cheers
Sam

Domenic wrote:
First, define the following reference...

Select E4

Insert Name Define

Name: Array

Refers to:

=MMULT(((Results+0)=LEFT(Sheet1!$A4,2)+0)+((Resul ts+0)=RIGHT(Sheet1!$A4,2
)+0),TRANSPOSE(COLUMN(Results)^0))

Click Ok

Then, enter the following formula in E4, and copy across...

=CHOOSE(2+SIGN(COLUMNS($E4:E4)-SUM(--(Array1))),SUM(LARGE(IF(Array1,ROW
(Results)-MIN(ROW(Results))+1),{0,1}+COLUMNS($E4:E4))*{1,-1})-1,MATCH(TRU
E,Array1,0)-1,"")

...confirmed with CONTROL+SHIFT+ENTER. Change the sheet reference
accordingly. Also, if you format Column A and 'Results' as text, you
can eliminate the '+0' bit from the defined reference, 'Array'.

Hope this helps!

Hi All,

[quoted text clipped - 34 lines]
Thanks
Sam


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200511/1