I want to built an array formula that accepts separated values of a single cell as input:
Cell A1: 1;3;4
Cell A2: ={Sum(If(A3:F3)=A1,A4:F4))}
How can I tell excel to intepret the string in A1 as array? I tried to set up a custom vba function, but I was not able to return the vba array correctly to the excel formula.
Can anyone help?
What I tried with VBA:
Function Matrix(vector)
Dim arr As Variant
arr = Array(Split(vector, ";"))
Matrix = arr
End Function
In the above formula I replace A1 by Matrix(A1). But the values of the vectors are returned as strings instead of integers (sorry, actually using a german Excel):
Thanks Peter
Split
returns an array, so what is the point ofArray
inArray(Split(vector, ";"))
? – John Coleman