Excel Matrix problem
Hello,
Or with a VBA function:
Function ap(vI As Variant) As Variant
Dim i As Long, j As Long, k As Long
ReDim vR(1 To (vI.Rows.Count -1)* (vI.Columns.Count -1), _
1 To 3) As Variant
k = 1
For i = 2 To vI.Rows.Count
For j = 2 To vI.Columns.Count
vR(k, 1) = vI(i, 1)
vR(k, 2) = vI(1, j)
vR(k, 3) = vI(i, j)
k = k + 1
Next j
Next i
ap = vR
End Function
Select a sufficient long range of rows (row count - 1 * column count -
1 of your input array) with 3 columns and array-enter =ap(A1:G13) if
your input data is in A1:G13.
Regards,
Bernd
|