organise multiple column entries to rows?

dappy

Board Regular
Joined
Apr 23, 2018
Messages
124
Office Version
  1. 2013
Platform
  1. Windows
Hi folks, i'm trying to get to a stage where i can do a vlook up and the simplest way i can think of is to organise the column information from column to row, so i have only one entry for each person, although i need the row value also to be sorted lowest value on the left. is this possible?

[TABLE="width: 651"]
<tbody>[TR]
[TD]name[/TD]
[TD]value[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]name[/TD]
[TD]value[/TD]
[TD]value[/TD]
[TD]value[/TD]
[TD]value[/TD]
[/TR]
[TR]
[TD]person1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]person1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]peson2[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD="colspan: 2"]goes to ->[/TD]
[TD][/TD]
[TD]person2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]person1[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]peson4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]person1[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]person2[/TD]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]peson4[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]peson4[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

thanks in advance!
 

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.
Welcome to the MrExcel board!

See if this helps.
Formula in D2 is copied down as far as you might need (after checking the rows - 100 in my formula - at least cover how big your data is)
Formula in E2 is copied across and down (again checking the rows referred to first)

Excel Workbook
ABCDEFGH
1namevaluename
2person12person1124
3person23person2311
4person11peson445
5person14
6person211
7peson44
8peson45
9
Rearrange Data
 
Last edited:
Upvote 0
Solution
Thanks Peter that is really fantastic, does the job perfectly!

I've been racking my brain for days over this :)

thanks again

Carl
 
Upvote 0
Hi Peter,

Many thanks for your code, it works perfectly however I've issues :D

I've put it into a module and i'm getting a runtime error.

this is correct though right?

Range("D2").Formula = "=IFERROR(INDEX($A$2:$A$100,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$100)+(A$2:A$100=""),0),0)),"")"

thanks again in advance

Carl
 
Upvote 0
this is correct though right?

Range("D2").Formula = "=IFERROR(INDEX($A$2:$A$100,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$100)+(A$2:A$100=""),0),0)),"")"
No, when inserting a formula like that with vba, you need to double-up the quote marks

Range("D2").Formula = "=IFERROR(INDEX($A$2:$A$100,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$100)+(A$2:A$100=""""),0),0)),"""")"
 
Upvote 0
No, when inserting a formula like that with vba, you need to double-up the quote marks

Range("D2").Formula = "=IFERROR(INDEX($A$2:$A$100,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$100)+(A$2:A$100=""""),0),0)),"""")"


Thanks again Peter. This forum is so popular, so many questions and this one disappeared way down the list quite quickly so cheekily i asked in a different question and was answered by Rory.

thanks again chaps

Carl
 
Upvote 0
Thanks again Peter. This forum is so popular, so many questions and this one disappeared way down the list quite quickly so cheekily i asked in a different question and was answered by Rory.

thanks again chaps

Carl
Glad you got your answer, but for the future, please be aware of #12 of the Forum Rules. Since I didn't know of the duplicate question, it seems my time answering here was really wasted. ;)
 
Upvote 0
Glad you got your answer, but for the future, please be aware of #12 of the Forum Rules. Since I didn't know of the duplicate question, it seems my time answering here was really wasted. ;)


Hi Peter,

Understood and sincere apologies for wasting you time.

Carl
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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