Concatenate, conditions, array formula?

PSJupiter2

New Member
Joined
Mar 18, 2015
Messages
7
Hello,

I have two sets of addresses. In one column there is a set of non duplicate house addresses. The second column has the mailing address of the owner of the house. I need to send letters to the home owners using a mail merge.


Physical AddressMailing Address
1929 55 AVE S1935 4 AVE NW
5527 20 ST S1935 4 AVE NW
2168 58 AVE S1935 4 AVE NW
2109 60 AVE S1935 4 AVE NW
3436 32 ST S1701 32 AVE S
3442 32 ST S1701 32 AVE S
3228 15 AVE N1701 32 AVE S
78 15 ST S1701 32 AVE S
456 ELM CT S1701 32 AVE S
1963 57 AVE S1701 32 AVE S
1455 EAGLE DR1455 EAGLE DR
6214 24 ST SPO BOX 534
3817 22 ST SPO BOX 534

<tbody>
</tbody>
If the data in column B is a duplicate value, I want to concatenate all of the corresponding values in column A into one column


Physical AddressMailing Address
1929 55 AVE S
5527 20 ST S
2168 58 AVE S
2109 60 AVE S
1935 4 AVE NW
3436 32 ST S
3442 32 ST S
3228 15 AVE N
78 15 ST S
456 ELM CT S
1963 57 AVE S
1701 32 AVE S
1455 EAGLE DR1455 EAGLE DR
6214 24 ST S
3817 22 ST S
PO BOX 534

<tbody>
</tbody>

The concatenate formula is something like:
=concatenate(A2,CHAR(10),A3,CHAR(10).....)

There are thousands of rows of data, so I don't want to manually type the above formula in.

I think I will be using some combination of: concatenate, index(match, vlookup, array formula, if

Can someone help me automate this or point me in a better direction?

Thank You

PSJupiter2
 
Last edited:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

Assuming the Physical and/or Mailing addresses are always grouped together (meaning won't repeat again further down the list), and by "concatenate", you actually mean having the "Physical Address" in separate rows:

C2 formula copied down.


Excel 2010
ABC
1Physical AddressMailing AddressNew Mailing Address Column
21929 55 AVE S1935 4 AVE NW1935 4 AVE NW
35527 20 ST S1935 4 AVE NW
42168 58 AVE S1935 4 AVE NW
52109 60 AVE S1935 4 AVE NW
63436 32 ST S1701 32 AVE S1701 32 AVE S
73442 32 ST S1701 32 AVE S
83228 15 AVE N1701 32 AVE S
978 15 ST S1701 32 AVE S
10456 ELM CT S1701 32 AVE S
111963 57 AVE S1701 32 AVE S
121455 EAGLE DR1455 EAGLE DR1455 EAGLE DR
136214 24 ST SPO BOX 534PO BOX 534
143817 22 ST SPO BOX 534
15
16Hide this Column
Sheet1
Cell Formulas
RangeFormula
C2=IF(B1<>B2,B2,"")

Hide Column B:

Excel 2010
AC
1Physical AddressNew Mailing Address Column
21929 55 AVE S1935 4 AVE NW
35527 20 ST S
42168 58 AVE S
52109 60 AVE S
63436 32 ST S1701 32 AVE S
73442 32 ST S
83228 15 AVE N
978 15 ST S
10456 ELM CT S
111963 57 AVE S
121455 EAGLE DR1455 EAGLE DR
136214 24 ST SPO BOX 534
143817 22 ST S
Sheet1
Cell Formulas
RangeFormula
C2=IF(B1<>B2,B2,"")
 
Upvote 0
Hello jtakw,

On one letter, I need the mail merge to list all of the "physical addresses" that correspond to the "mailing address".

This will prevent one property owner from getting an many individual letters.

Therefore, I believe I need the Physical addresses to be in one cell and separated by carriage returns.

Hi,

Assuming the Physical and/or Mailing addresses are always grouped together (meaning won't repeat again further down the list), and by "concatenate", you actually mean having the "Physical Address" in separate rows:
 
Upvote 0
OK, I can accomplish what you described by using 2 helper columns (that you can hide) like below:


Excel 2010
ABCDEF
1Physical AddressMailing Address1st Helper2nd HelperNew Physical Address ColumnNew Mailing Address Column
21929 55 AVE S1935 4 AVE NW 1929 55 AVE S1929 55 AVE S 5527 20 ST S 2168 58 AVE S 2109 60 AVE S1935 4 AVE NW
35527 20 ST S1935 4 AVE NW1929 55 AVE S 5527 20 ST S3436 32 ST S 3442 32 ST S 3228 15 AVE N 78 15 ST S 456 ELM CT S 1963 57 AVE S1701 32 AVE S
42168 58 AVE S1935 4 AVE NW1929 55 AVE S 5527 20 ST S 2168 58 AVE S1455 EAGLE DR1455 EAGLE DR
52109 60 AVE S1935 4 AVE NW11929 55 AVE S 5527 20 ST S 2168 58 AVE S 2109 60 AVE S6214 24 ST S 3817 22 ST SPO BOX 534
63436 32 ST S1701 32 AVE S3436 32 ST S
73442 32 ST S1701 32 AVE S3436 32 ST S 3442 32 ST S
83228 15 AVE N1701 32 AVE S3436 32 ST S 3442 32 ST S 3228 15 AVE N
978 15 ST S1701 32 AVE S3436 32 ST S 3442 32 ST S 3228 15 AVE N 78 15 ST S
10456 ELM CT S1701 32 AVE S3436 32 ST S 3442 32 ST S 3228 15 AVE N 78 15 ST S 456 ELM CT S
111963 57 AVE S1701 32 AVE S23436 32 ST S 3442 32 ST S 3228 15 AVE N 78 15 ST S 456 ELM CT S 1963 57 AVE S
121455 EAGLE DR1455 EAGLE DR31455 EAGLE DR
136214 24 ST SPO BOX 5346214 24 ST S
143817 22 ST SPO BOX 53446214 24 ST S 3817 22 ST S
Sheet1
Cell Formulas
RangeFormula
C2=IF(B2<>B3,MAX(C$1:C1)+1,"")
D2=IF(B2<>B1,A2,D1&CHAR(10)&A2)
E2=IFERROR(VLOOKUP(SMALL(C$2:C$14,ROW(A1)),C$2:D$14,2,0),"")
F2=IFERROR(INDEX(B$2:B$14,MATCH(SMALL(C$2:C$14,ROW(A1)),C$2:C$14,0)),"")

Formulas copied down.
 
Upvote 0
Hi Jtakw,

This worked! Thank you for your quick reply.

Of note for anyone else using this method:

For this to work for you, the data set that is not to be grouped into one cell will need to be arranged in ascending order. In my case, because the mailing address is the "primary key" of sorts, they need to be ascended in order for the matching physical addresses to be grouped properly.

Thanks again for the help!

PSJupiter2
 
Upvote 0
You're welcome.

Actually, for the original data, the "Mailing Address" column can be in any sorted order, as long as it results in the "Physical Address" being grouped for that Mailing Address.
 
Upvote 0

Similar threads

Forum statistics

Threads
1,214,875
Messages
6,122,046
Members
449,063
Latest member
ak94

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