Formulas aren't really my thing, but I'm trying to get better with them and I've run into a bit of a stumbling block. It feels like there should be a way to concatenate an array in formulas, but I can't work out how to do it and googling didn't turn up much.
I posted the following formula to turn a string into buttons to press on a phone keypad to "dial" the text:
Whilst it works, it requires dragging across so that you get one number in each cell - which is a bit of a pain, so my question is whether there is a way to concat the array to return a string with all the array values - I know concat doesn't work (and I can't actually find a useful application of concatenate anyway), but is there any nifty way of doing something like the below?
Ah that's really clever, I'd have never thought about multiplying it out and summing it like that I'm guessing from your reply that there's no simple nifty concat function that I don't know about then?
Unfortunately not. This type of 'workaround' will only work on numerical concatenation (and only in specific cases).
And unless Microsoft have got round to it in 2013 (which I doubt), us worksheet function-users will continue to be left mystified as to why a concatenating function which can be passed arrays is still not in existence.
Guess that leaves multiple string-concatenation firmly in the VBA field for the time being.
The code is more extensive and accounts for the most common conditions when wanting to conditionally concatenate ranges. Most of the processing is done within the UDF which allows for simple formulas.
Make a table in, say, D1:E36 like below - note that the numbers in blue in column D are entered as text, i.e., '0 '1 '2....
D
E
1
0
0
2
1
1
3
2
2
4
3
3
5
4
4
6
5
5
7
6
6
8
7
7
9
8
8
10
9
9
11
A
2
12
B
2
13
C
2
14
D
3
15
E
3
16
F
3
17
G
4
18
H
4
19
I
4
20
J
5
21
K
5
22
L
5
23
M
6
24
N
6
25
O
6
26
P
7
27
Q
7
28
R
7
29
S
7
30
T
8
31
U
8
32
V
8
33
W
9
34
X
9
35
Y
8
36
Z
9
A
B
1
1-866-ICICI-4U
1-866-424-2448
2
1-800-PRINT-ME
1-800-774-6863
3
1-800-FLOWERS
1-800-356-9377
4
1-800-APL-CARE
1-800-275-2273
Array formula in B1 copied down
=TEXT(Aconcat(LOOKUP(MID(SUBSTITUTE(A1,"-",""),ROW(INDIRECT("1:"&LEN(SUBSTITUTE(A1,"-","")))),1),$D$1:$D$36,$E$1:$E$36)),"0-000-000-0000")
confirmed with Ctrl+Shift+Enter
The code is more extensive and accounts for the most common conditions when wanting to conditionally concatenate ranges. Most of the processing is done within the UDF which allows for simple formulas.
Bookmarks