# Problem (question) with CONCATENATE function

#### ericcartman

##### New Member
Hello guys, and thanks in advance if someone is willing to help me with this issue.

I have excel file for generating invoices. Now I need 2D barcode. I decided to buy Tbarcode plugin. But for that plugin to work, all data needs to be in one cell (16 lines, divides with newline)
I am sending screenshot. Maybe there is an easier way to do it with PowerQuery? I googled for a few hours and didn't find anything useful for my example
So this are my problems:
- in barcode field (on the right) text is without newline so barcode cannot be generated with needed values - so I need it exactly as in cell B2 in separate lines
- cell B2: Lines in blue needs to be transfered from 4 different cells into this one large for barcode generator. Is is irrelevant which ones so I called them B11-B14 now, and lines colored green are fixed values.

#### Attachments

• Untitled.jpg
92.7 KB · Views: 6

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### GraH

##### Well-known Member
Maybe you can try = Textjoin(char(10), TRUE, Range)

PS: consider posting sample data using the XL2BB.

Power Query example + formula solution:
Book1
ABCDEFG
1
2Barcode DataFormulaPQ
3Line 1Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 Line 12 Line 13 Line 14 Line 15 Line 16Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 Line 12 Line 13 Line 14 Line 15 Line 16
4Line 2
5Line 3
6Line 4
7Line 5
8Line 6
9Line 7
10Line 8
11Line 9
12Line 10
13Line 11
14Line 12
15Line 13
16Line 14
17Line 15
18Line 16
Sheet1
Cell Formulas
RangeFormula
D3D3=TEXTJOIN(CHAR(10),TRUE,Table1[Barcode Data])

Code:
``````let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Text.Combine(Table.TransformColumnTypes(Source,{{"Barcode Data", type text}})[Barcode Data], "#(lf)")
in
#"Changed Type"``````

Last edited:

#### ericcartman

##### New Member
wow thanks for fast reply GraH. Excatly what I needed. It works (I just needed to "wrap text" for D3)

#### GraH

##### Well-known Member
Yes, wrapping is needed. Must think to mention those things explicitely.
Glad it worked out for you.

Replies
3
Views
197
Replies
8
Views
74
Replies
2
Views
176
Replies
3
Views
123
Replies
6
Views
433

1,127,354
Messages
5,624,200
Members
416,017
Latest member
moritz210

### 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.

### Which adblocker are you using?

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

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