Concatenate text with in SUMPRODUCT

L

Legacy 143009

Guest
Hey,

I was thinking about this question in a different way;
https://www.mrexcel.com/forum/excel...dentifier.html?highlight=order+mix+identifier

So let's think you have:
A B
1 a
1 b
1 b
2 c
2 d

And let say I want the end result in Column C as:
C
ab
ab
ab
cd
cd

So how about merging unique texts in SUMPRODUCT function? Maybe something like:
=SUMPRODUCT(($A$1:$A$5=A1)*CONCATENATE(SOMEUNIQUEVALUESARRAY($B$1:$B$5)))

First question, what can be the formula for SOMEUNIQUEVALUESARRAY($B$1:$B$5)?
Second question, even it's possible return unique values, its length will be 2. How to multiply it by 3 in SUMPRODUCT?
The third and the last, it it possible to concatenate text?

At least how to try:
SUMPRODUCT(($A$1:$A$5=A1)*CONCATENATE($B$1:$B$5))
and have
abb
abb
abb
cd
cd

Thanks a lot!!
 
Last edited by a moderator:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
With Excel 2016...


A
B
C
1
Order​
Tyoe​
Result​
2
1​
a​
ab​
3
1​
b​
ab​
4
1​
b​
ab​
5
2​
c​
cd​
6
2​
d​
cd​

<tbody>
</tbody>


Array formula in C2 copied down
=TEXTJOIN(,1,IF(FREQUENCY(IF(A$2:A$6=A2,MATCH(B$2:B$6,B$2:B$6,0)),ROW(B$2:B$6)-ROW(B$2)+1),B$2:B$6,""))

With earlier versions, because the TEXTJOIN function is not available, a macro is required.

M.
 
Last edited:
Upvote 0
With Excel 2016...


A
B
C
1
Order​
Tyoe​
Result​
2
1​
a​
ab​
3
1​
b​
ab​
4
1​
b​
ab​
5
2​
c​
cd​
6
2​
d​
cd​

<tbody>
</tbody>


Array formula in C2 copied down
=TEXTJOIN(,1,IF(FREQUENCY(IF(A$2:A$6=A2,MATCH(B$2:B$6,B$2:B$6,0)),ROW(B$2:B$6)-ROW(B$2)+1),B$2:B$6,""))

With earlier versions, because the TEXTJOIN function is not available, a macro is required.

M.

I know, TEXTJOIN will work, no problem. I'll check when I arrive home.
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top