Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Replace function with array formula

Hi,
Question: What is the array formula equivalent (not a function or macro)
that will return an array with the same results as the function below?

Given a range of values (text or numbers):
13
13
14
13
14
13
13
14
13
13
14
13
13
14

The following function will return the count of cells between each 14:

Returns : ,3,2,3,3,3

Function valuesbetween(MyRange, MyValue)
Count = 0
For Each zzz In MyRange
Count = Count + 1
If zzz = MyValue Then
mytotal = mytotal & "," & Count
Count = 0
Else
End If
Next zzz
valuesbetween = mytotal
End Function





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default Replace function with array formula

If your data is in col A, then in C2, say (C1 being blank),
ctrl/shift/enter:
=MATCH(TRUE,OFFSET($A$1:$A$14,SUM($C$1:C1),0)=14,0 )
and fill down.


"Don" wrote in message
...
Hi,
Question: What is the array formula equivalent (not a function or macro)
that will return an array with the same results as the function below?

Given a range of values (text or numbers):
13
13
14
13
14
13
13
14
13
13
14
13
13
14

The following function will return the count of cells between each 14:

Returns : ,3,2,3,3,3

Function valuesbetween(MyRange, MyValue)
Count = 0
For Each zzz In MyRange
Count = Count + 1
If zzz = MyValue Then
mytotal = mytotal & "," & Count
Count = 0
Else
End If
Next zzz
valuesbetween = mytotal
End Function







  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Replace function with array formula

Thanks Bob - It works great.


"Bob Umlas" wrote in message
...
If your data is in col A, then in C2, say (C1 being blank),
ctrl/shift/enter:
=MATCH(TRUE,OFFSET($A$1:$A$14,SUM($C$1:C1),0)=14,0 )
and fill down.


"Don" wrote in message
...
Hi,
Question: What is the array formula equivalent (not a function or macro)
that will return an array with the same results as the function below?

Given a range of values (text or numbers):
13
13
14
13
14
13
13
14
13
13
14
13
13
14

The following function will return the count of cells between each 14:

Returns : ,3,2,3,3,3

Function valuesbetween(MyRange, MyValue)
Count = 0
For Each zzz In MyRange
Count = Count + 1
If zzz = MyValue Then
mytotal = mytotal & "," & Count
Count = 0
Else
End If
Next zzz
valuesbetween = mytotal
End Function









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
Replace the Find Function with a formula CHARLENE Excel Worksheet Functions 1 January 23rd 08 04:46 AM
Formula to replace a Pivot table function Sunnyskies Excel Discussion (Misc queries) 3 June 6th 07 07:49 AM
How to replace a function with its resulting reference in a formula? Dmitry Kopnichev Excel Worksheet Functions 7 October 13th 05 09:48 PM
How to replace a function with its result or resulting reference in a formula? Dmitry Kopnichev Excel Worksheet Functions 5 October 13th 05 12:15 PM
IF function with Array Formula Moreaudjd Excel Programming 4 April 12th 04 03:29 AM


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