Problem (question) with CONCATENATE function

ericcartman

New Member
Joined
Aug 2, 2020
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
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 :oops:
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
    Untitled.jpg
    92.7 KB · Views: 8

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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:
Upvote 0
wow thanks for fast reply GraH. Excatly what I needed. It works (I just needed to "wrap text" for D3)
 
Upvote 0
Yes, wrapping is needed. Must think to mention those things explicitely.
Glad it worked out for you.
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

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