If by the above you're implying delimited strings in both % Chg & Seq columns then I would say a VBA approach is something of a no-brainer
(a formula driven approach would be both convoluted and inefficient)
Taking the VBA route further... given the nature of the process I would err towards a Sub Routine (run as and when) as opposed to UDF [repetitive calls & overhead]
(you could add ChangeEvent to invoke the Sub Routine if necessary)
Using your most recent file as example below would be one possible route:
Sub Example()
Dim vData As Variant, vRes() As Variant
Dim lngSeq As Long, lngPct As Long
Dim dblPct As Double
With Sheets("Sheet3")
With .Range(.Cells(2, "A"), .Cells(.Rows.Count, "A").End(xlUp)).Resize(, 2)
vData = .Value
With .Offset(, 2)
.ClearContents
ReDim vRes(1 To UBound(vData, 1), 1 To UBound(vData, 2))
For lngSeq = LBound(vData, 1) To UBound(vData, 1) - 1 Step 1
dblPct = 0
For lngPct = lngSeq + 1 To UBound(vData, 1) Step 1
dblPct = dblPct + CDbl(vData(lngPct, 2))
If dblPct >= 0.1 Then
vRes(lngPct, 1) = vRes(lngPct, 1) & String(0 - (vRes(lngPct, 1) <> ""), ",") & Format(dblPct, "0.00%")
vRes(lngPct, 2) = vRes(lngPct, 2) & String(0 - (vRes(lngPct, 2) <> ""), ",") & vData(lngSeq, 1)
Exit For
End If
Next lngPct
Next lngSeq
.NumberFormat = "@"
.Value = vRes
.Columns.AutoFit
End With
End With
End With
End Sub
the above would be stored in a standard module and run as and when (or invoked via Event as nec.)
I have taken the liberty of attaching your data with above code in place and with button present on sheet used to invoke the routine.
(you must ensure Macros are enabled of course)
Bookmarks