Transposing Data based on unique values

smilie224

New Member
Joined
Nov 18, 2014
Messages
19
I am looking to transpose values from column B to columns B, C, D based on a unique value in column A. It seems it should be easy, but I have run into a lot of difficulty and have resulted to manually completing. In frustration, now I am trying here to see if anyone is available this weekend :)

I am using Excel for Mac 2011. Here is a sample of what I am hoping for.
The name column (A) varies in how many rows it has per person. I am just trying to locate the next unique name, copy/paste data from column B into either columns B, C, or D respectively.

All on the same worksheet. (Hoping my sample paste here will work)
<style>table { }td { padding-top: 1px; padding-right: 1px; padding-left: 1px; color: black; font-size: 11pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri,sans-serif; vertical-align: bottom; border: medium none; white-space: nowrap; }.xl63 { border-width: medium medium medium 1pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color windowtext; }.xl64 { border-width: medium 1pt medium medium; border-style: none solid none none; border-color: -moz-use-text-color windowtext -moz-use-text-color -moz-use-text-color; }.xl65 { border-width: medium medium 1pt 1pt; border-style: none none solid solid; border-color: -moz-use-text-color -moz-use-text-color windowtext windowtext; }.xl66 { border-width: medium medium 1pt; border-style: none none solid; border-color: -moz-use-text-color -moz-use-text-color windowtext; }.xl67 { border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; }.xl68 { text-align: center; border-width: 1pt medium medium 1pt; border-style: solid none none solid; border-color: windowtext -moz-use-text-color -moz-use-text-color windowtext; background: rgb(217, 217, 217) none repeat scroll 0% 0%; }.xl69 { text-align: center; border-width: 1pt medium medium; border-style: solid none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; background: rgb(217, 217, 217) none repeat scroll 0% 0%; }.xl70 { text-align: center; border-width: 1pt 1pt medium medium; border-style: solid solid none none; border-color: windowtext windowtext -moz-use-text-color -moz-use-text-color; background: rgb(217, 217, 217) none repeat scroll 0% 0%; }.xl71 { border-width: medium medium medium 1pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color windowtext; background: rgb(216, 228, 188) none repeat scroll 0% 0%; }.xl72 { background: rgb(216, 228, 188) none repeat scroll 0% 0%; }.xl73 { border-width: medium 1pt medium medium; border-style: none solid none none; border-color: -moz-use-text-color windowtext -moz-use-text-color -moz-use-text-color; background: rgb(216, 228, 188) none repeat scroll 0% 0%; }.xl74 { text-align: center; border-width: medium medium medium 1pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color windowtext; background: rgb(217, 217, 217) none repeat scroll 0% 0%; }.xl75 { text-align: center; background: rgb(217, 217, 217) none repeat scroll 0% 0%; }.xl76 { text-align: center; border-width: medium 1pt medium medium; border-style: none solid none none; border-color: -moz-use-text-color windowtext -moz-use-text-color -moz-use-text-color; background: rgb(217, 217, 217) none repeat scroll 0% 0%; }</style>
Current Data
Column AColumn BColumn CColumn D
NameField 1Field 2Field 3
JohnText1
JohnText2
JohnText3
MaryNText1
MaryNText2
SusanYText1
TimZText1
TimZText2
Desired Data
Column AColumn BColumn CColumn D
NameField 1Field 2Field 3
JohnText1Text2Text3
MaryNText1NText2
SusanYText1
TimZText1ZText2

<colgroup><col style="width:65pt" span="5" width="65"> </colgroup><tbody>
</tbody>
 
Last edited:
Oh My God, it works like magic :)
Thanks, AlphaFrog for spending time amending script #5 for me. It works wonders.

Cheers and have a good day ahead!
Sorry, I just realised the transposed product info is all the same. For example, it created 5 columns of PA products under Customer A. Any remedy to this?

Thanks in advance.
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi, lightspeed
If you already have Dynamic Array function in your Office 365, then try this ( it uses Unique Function):
VBA Code:
Sub a856938a()
'https://www.mrexcel.com/board/threads/transposing-data-based-on-unique-values.856938/
Dim i As Long, j As Long, n As Long
Dim r As Range
Dim ary

Application.ScreenUpdating = False
Set r = Range("A1", Cells(Rows.Count, "A").End(xlUp))
va = r
p = 1
For i = 2 To UBound(va, 1)
    z = i + WorksheetFunction.CountIf(r, va(i, 1)) - 1 'case insensitive
    ary = WorksheetFunction.Unique(Range("B" & i & ":B" & z))
    p = p + 1
    Range("D" & p) = Range("A" & i)
    Range("E" & p).Resize(1, UBound(ary)) = Application.Transpose(ary)
    i = z
Next
Application.ScreenUpdating = True
End Sub

Example:
Book1
ABCDEFG
1
2ATrumanATrumanRidgeAxl
3ATrumanBIsaacLeandro
4ATrumanCGiovanniRod
5ARidge
6AAxl
7BIsaac
8BLeandro
9BIsaac
10CGiovanni
11CRod
Sheet2
 
Upvote 0

Forum statistics

Threads
1,215,963
Messages
6,127,951
Members
449,412
Latest member
montand

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