Excel 2016 (Windows) 32 bit | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
2 | a | 1 | a | 1100 | |||
3 | b | 2 | b | 2101 | |||
4 | c | 3 | c | 3102 | |||
5 | d | 4 | d | 4103 | |||
6 | a | 100 | |||||
7 | b | 101 | |||||
8 | c | 102 | |||||
9 | d | 103 | |||||
Sheet2 (3) |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2 | {=TEXTJOIN("",TRUE,IF(A$2:A$9=D2,B$2:B$9,""))+0} | |
Press CTRL+SHIFT+ENTER to enter array formulas. |
No, Excel 2007 does not have TEXTJOIN, that's why I specified Excel 2016.thank you for your help and we are useing excel 2007 which i could not able to find "TEXTJOIN" function. thanks again
Then without the TEXTJOIN function it isn't feasible with a worksheet formula. You could try this user-defined function. To implement ..it will be more than 2 not more than 20.
Function myConcat(sMatchValue As String, rData As Range) As String
Dim aData As Variant
Dim i As Long
aData = rData.Value
For i = 1 To UBound(aData)
If aData(i, 1) = sMatchValue Then myConcat = myConcat & "," & aData(i, 2)
Next i
myConcat = Mid(myConcat, 2)
End Function
Excel 2016 (Windows) 32 bit | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | |||||||
2 | a | 1 | a | 1,100,test1,test100 | |||
3 | b | 2 | b | 2,101,test2,test101 | |||
4 | c | 3 | c | 3,102,test3,test102 | |||
5 | d | 4 | d | 4,103,test4,test103 | |||
6 | a | 100 | |||||
7 | b | 101 | |||||
8 | c | 102 | |||||
9 | d | 103 | |||||
10 | a | test1 | |||||
11 | b | test2 | |||||
12 | c | test3 | |||||
13 | d | test4 | |||||
14 | a | test100 | |||||
15 | b | test101 | |||||
16 | c | test102 | |||||
17 | d | test103 | |||||
myConcat |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2 | =myConcat(D2,A$2:B$17) |