Combining two columns in one(not concut)

datastudent

Board Regular
Joined
Sep 7, 2021
Messages
60
Office Version
  1. 365
Platform
  1. Windows
Hi,

Please help me combine two set of data in one column without using pivot.

The first table is the data that I have and the second table is how I want it to be. I would like a formula that would give me the result for both tables please like if I have table2 how do I get table1 and vice versa. Thank you!

Template_v1.xlsm
ABCDEFG
1NameFixedMobileNameServiceCost
2AAA123122AAAFixed123
3BBB234345AAAMobile122
4BBBFixed234
5BBBMobile345
Sheet7
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try:
Book2
ABCDEFG
1NameFixedMobileNameServiceCost
2AAA123122AAAFixed123
3BBB234345AAAMobile122
4BBBFixed234
5BBBMobile345
Sheet5
Cell Formulas
RangeFormula
E2:G5E2=DROP(REDUCE("",TOCOL(A2:A3&"|"&B1:C1&"|"&B2:C3),LAMBDA(x,y,VSTACK(x,TEXTSPLIT(y,"|")))),1)
Dynamic array formulas.
 
Upvote 0
Another option
Excel Formula:
=LET(d,B2:C3,HSTACK(TOCOL(IF(d<>"",A2:A3,1/0),2),TOCOL(IF(d<>"",B1:C1,1/0),2),TOCOL(d,1)))
 
Upvote 0
Solution
Another option

25 01 25.xlsm
ABCDEFG
1NameFixedMobileNameServiceCost
2AAA123122AAAFixed123
3BBB234345AAAMobile122
4BBBFixed234
5BBBMobile345
2 to 1
Cell Formulas
RangeFormula
E2:G5E2=TEXTSPLIT(TEXTJOIN(":",,A2:A3&"|"&B1:C1&"|"&B2:C3),"|",":")
Dynamic array formulas.


The above formula returns text values in column G (as does the suggestion in post2). If those values need to be numerical then

25 01 25.xlsm
ABCDEFG
1NameFixedMobileNameServiceCost
2AAA123122AAAFixed123
3BBB234345AAAMobile122
4BBBFixed234
5BBBMobile345
2 to 1 (2)
Cell Formulas
RangeFormula
E2:G5E2=LET(t,TEXTSPLIT(TEXTJOIN(":",,A2:A3&"|"&B1:C1&"|"&B2:C3),"|",":"),IFERROR(--t,t))
Dynamic array formulas.



.. both tables ... like if I have table2 how do I get table1

25 01 25.xlsm
ABCDEFG
1NameFixedMobileNameServiceCost
2AAA123122AAAFixed123
3BBB234345AAAMobile122
4BBBFixed234
5BBBMobile345
1 to 2
Cell Formulas
RangeFormula
A2:C3A2=HSTACK(UNIQUE(E2:E5),WRAPROWS(G2:G5,2))
Dynamic array formulas.
 
Upvote 0
TEXTJOIN method has character limitation so I stopped suggesting it.
 
Upvote 0
and yet one more option with power query. Unpivot your data

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"
 
Upvote 0

Forum statistics

Threads
1,225,969
Messages
6,188,111
Members
453,460
Latest member
Cjohnson3

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