So I am inclined to go back to using your array formulas to calculate Gini coefficients.

]]>According to Steve Daltons Book

“Financial applications using Excel add-ibn development in C/C++” 2.edition Page 362

the behaviour of xlfEvaluat depenfs whether the function is registered as worksheet functions or macro worksheet function/command ]]>

Given that the evaluate method evaluates a string expression, such a expression can be provided dynamically and concatenated, say, through a function procedure. So I created a function called MAP which takes an array parameter, and a string expression, and evaluates each element of the array in conjunction with the string expression. You can see my code below:

Option Explicit

Function MAP(arr(), expr As String)

Dim i As Long

For i = LBound(arr) To UBound(arr)

arr(i) = Worksheets(activesheet.name”).Evaluate(arr(i) & expr)

Next i

MAP = arr

End Function

Sub subby()

Dim va(2) As Variant, arr() As Variant, i As Long

va(0) = 2

va(1) = 4

va(2) = 6

arr = MAP(va, “/2”)

For i = LBound(arr) To UBound(arr)

Debug.Print arr(i)

Next i

‘debug.prints 1, 2, and 3

End Sub

Thinking about this function, I thought about how you could achieve similar functionality using array formulas in Excel (e.g. “={2,4,6}/2”) So I wondered if such a construct would would in VBA, and it does. This can be achieved like so:

Sub subby2()

Dim arr As Variant, i As Long

arr = Worksheets(ActiveSheet.Name).Evaluate(“{2,4,6}/2”)

For i = LBound(arr) To UBound(arr)

Debug.Print arr(i)

Next i

‘debug.prints 1, 2, 3

End Sub

]]>If you can not use “xlsm”, you may use:

——————————-

=AGGREGATE(15;6;FIND(

PROPER(MID($A5;

ROW($A$1:INDEX($A$1:$A$256;LEN($A5)));

1));$A5;

1);

1)

——————————

In you system maybe “;” -> “,”.

——————————-

=AGGREGATE(15,6,FIND(

PROPER(MID($A5,

ROW($A$1:INDEX($A$1:$A$256,LEN($A5)));

1)),$A5,

1),

1)

——————————

It is nearly 10 times faster than your first CSEformula and you can choose position of the 1st, 2…n capital letter ðŸ˜‰

]]>Did you play around with Dynamic Array formulas – Like SORT / FILTER / SEQUENCE etc ]]>

please accept my gratitude! ]]>