Extract Date sorted list from multiple columns stored in a table

vampsthevampyre

New Member
Joined
Apr 29, 2016
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Afternoon All,

I thought it would be a good idea to have my data inputted horizontally instead of vertically as I got bored of scrolling to the bottom of a table to add more data and it was easy to see the transactions for each company's shares. Now I have the issue that I cannot easily see what the last share transactions were (Make one job easy just to make a subsequent job ten times harder - seems to be a trend in the way I work).

If anybody can help I'm looking to create a list similar to C4 but also pulls in the data from not only from column I4 (Date1)but L4, O4, S4 (Date2,3 and 4 respectively) and potentially other columns as the data table increases over time.

The table will always consist of the headers (Name, Date, Shares and ShareCost) with the suffix of 1,2,3 etc.

The new table would look a bit like this

NameDateSharesCost
HLMA.LSE23/01/2023452141.64
SPX.LSE23/01/2023811543.6
BME.LSE14/02/2023207476.69
SGE.LSE27/02/2023130755.71
HLMA.LSE07/03/2023-452141.64
SPX.LSE07/03/2023-811543.6

Any help would be gratefully received

Regards
Ian

Book1
ABCDEFGHIJKLMNOPQRSTU
1
2
3NameDateSharesCostNameDate1Shares1ShareCost1Date2Shares2ShareCost2Date3Shares3ShareCost3Date4Shares4ShareCost4
4HLMA.LSE23/01/2023452141.64BA..LSE12/05/2023105988.422/05/2023-105988.4
5SPX.LSE23/01/2023811543.6BATS.LSE13/03/2023453040.516/05/2023352738.5277
6BME.LSE14/02/2023207476.69BME.LSE14/02/2023207476.6912/06/202328563.1786
7SGE.LSE27/02/2023130755.71CRDA.LSE12/05/202313683522/05/2023-136835
8BATS.LSE13/03/2023453040.5CGS.LSE15/05/2023261376.5
9CSN.LSE13/03/2023340284CSN.LSE13/03/202334028416/05/2023342286.6513/06/202318283.3889
10GLEN.LSE13/03/2023378456.6DCC.LSE12/05/2023204732.5
11GSK.LSE13/03/2023201387DGE.LSE12/05/202343528.25
12KETL.LSE13/03/202395692.8GLEN.LSE13/03/2023378456.616/05/2023225437.23705/06/202315435.8625
13LGEN.LSE13/03/2023378241.3GSK.LSE13/03/202320138712/05/2023441481.9
14MNG.LSE13/03/2023471207.5HLMA.LSE23/01/2023452141.6407/03/2023-452141.64
15MONY.LSE13/03/20231300232.4KETL.LSE13/03/202395692.8
16NG..LSE13/03/2023911064.25LGEN.LSE13/03/2023378241.316/05/2023423231.909813/06/202322238.1818
17PHNX.LSE13/03/2023153598.6LMP.LSE15/05/2023521188.472
18PHP.LSE13/03/20231349100.6MGNS.LSE22/05/2023521857.2
19PSN.LSE13/03/2023661217.25MNG.LSE13/03/2023471207.516/05/2023492199.696
20RIO.LSE13/03/2023315462MONY.LSE13/03/20231300232.413/06/202342262.7143
21THRL.LSE13/03/2023120470.95NG..LSE13/03/2023911064.25
22VOD.LSE13/03/2023204296.615PHNX.LSE13/03/2023153598.616/05/2023170575.3713/06/20236553.5
23VTY.LSE13/03/2023129762.25PHP.LSE13/03/20231349100.613/06/202322100.818
24BA..LSE12/05/2023105988.4PSN.LSE13/03/2023661217.25
25CRDA.LSE12/05/2023136835RIO.LSE13/03/202331546216/05/2023194966.5
26DCC.LSE12/05/2023204732.5SGE.LSE27/02/2023130755.7107/03/2023-130755.71
27DGE.LSE12/05/202343528.25SPX.LSE23/01/2023811543.607/03/2023-811543.6
28ULVR.LSE12/05/2023684340SRE.LSE15/05/2023126278.246
29UU..LSE12/05/2023931077THRL.LSE13/03/2023120470.9516/05/2023119082.57313/06/20232275.1364
30CGS.LSE15/05/2023261376.5TND.LSE22/05/2023359247.2
31LMP.LSE15/05/2023521188.472ULVR.LSE12/05/2023684340
32SRE.LSE15/05/2023126278.246UU..LSE12/05/2023931077
33MGNS.LSE22/05/2023521857.2VOD.LSE13/03/2023204296.61516/05/2023113786.45716/05/202351285
34TND.LSE22/05/2023359247.2VTY.LSE13/03/2023129762.2513/06/20235753.8
35
36
Sheet1
Cell Formulas
RangeFormula
C4:F34C4=SORTBY(tblSharePurchases[[Name]:[ShareCost1]],tblSharePurchases[Date1],1)
Dynamic array formulas.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Not sure if the below will help as I don't know how many columns there would be:
Book1
ABCDEFGHIJKLMNO
1NameDate1Shares1ShareCost1Date2Shares2ShareCost2Date3Shares3ShareCost3NameDateSharesCost
2BA..LSE12/05/2023105988.422/05/2023-105988.4HLMA.LSE23/01/2023452141.64
3BATS.LSE13/03/2023453040.516/05/2023352738.5277SPX.LSE23/01/2023811543.6
4BME.LSE14/02/2023207476.6912/06/202328563.1786BME.LSE14/02/2023207476.69
5CRDA.LSE12/05/202313683522/05/2023-136835SGE.LSE27/02/2023130755.71
6CGS.LSE15/05/2023261376.5HLMA.LSE07/03/2023-452141.64
7CSN.LSE13/03/202334028416/05/2023342286.6513/06/202318283.3889SGE.LSE07/03/2023-130755.71
8DCC.LSE12/05/2023204732.5SPX.LSE07/03/2023-811543.6
9DGE.LSE12/05/202343528.25BATS.LSE13/03/2023453040.5
10GLEN.LSE13/03/2023378456.616/05/2023225437.23705/06/202315435.8625CSN.LSE13/03/2023340284
11GSK.LSE13/03/202320138712/05/2023441481.9GLEN.LSE13/03/2023378456.6
12HLMA.LSE23/01/2023452141.6407/03/2023-452141.64GSK.LSE13/03/2023201387
13KETL.LSE13/03/202395692.8KETL.LSE13/03/202395692.8
14LGEN.LSE13/03/2023378241.316/05/2023423231.909813/06/202322238.1818LGEN.LSE13/03/2023378241.3
15LMP.LSE15/05/2023521188.472MNG.LSE13/03/2023471207.5
16MGNS.LSE22/05/2023521857.2MONY.LSE13/03/20231300232.4
17MNG.LSE13/03/2023471207.516/05/2023492199.696NG..LSE13/03/2023911064.25
18MONY.LSE13/03/20231300232.413/06/202342262.7143PHNX.LSE13/03/2023153598.6
19NG..LSE13/03/2023911064.25PHP.LSE13/03/20231349100.6
20PHNX.LSE13/03/2023153598.616/05/2023170575.3713/06/20236553.5PSN.LSE13/03/2023661217.25
21PHP.LSE13/03/20231349100.613/06/202322100.818RIO.LSE13/03/2023315462
22PSN.LSE13/03/2023661217.25THRL.LSE13/03/2023120470.95
23RIO.LSE13/03/202331546216/05/2023194966.5VOD.LSE13/03/2023204296.615
24SGE.LSE27/02/2023130755.7107/03/2023-130755.71VTY.LSE13/03/2023129762.25
25SPX.LSE23/01/2023811543.607/03/2023-811543.6BA..LSE12/05/2023105988.4
26SRE.LSE15/05/2023126278.246CRDA.LSE12/05/2023136835
27THRL.LSE13/03/2023120470.9516/05/2023119082.57313/06/20232275.1364DCC.LSE12/05/2023204732.5
28TND.LSE22/05/2023359247.2DGE.LSE12/05/202343528.25
29ULVR.LSE12/05/2023684340ULVR.LSE12/05/2023684340
30UU..LSE12/05/2023931077UU..LSE12/05/2023931077
31VOD.LSE13/03/2023204296.61516/05/2023113786.45716/05/202351285GSK.LSE12/05/2023441481.9
32VTY.LSE13/03/2023129762.2513/06/20235753.8CGS.LSE15/05/2023261376.5
33LMP.LSE15/05/2023521188.472
34SRE.LSE15/05/2023126278.246
35BATS.LSE16/05/2023352738.528
36CSN.LSE16/05/2023342286.65
37GLEN.LSE16/05/2023225437.237
38LGEN.LSE16/05/2023423231.9098
39MNG.LSE16/05/2023492199.696
40PHNX.LSE16/05/2023170575.37
41RIO.LSE16/05/2023194966.5
42THRL.LSE16/05/2023119082.573
43VOD.LSE16/05/2023113786.457
44VOD.LSE16/05/202351285
45MGNS.LSE22/05/2023521857.2
46TND.LSE22/05/2023359247.2
47BA..LSE22/05/2023-105988.4
48CRDA.LSE22/05/2023-136835
49GLEN.LSE05/06/202315435.8625
50BME.LSE12/06/202328563.1786
51MONY.LSE13/06/202342262.7143
52PHP.LSE13/06/202322100.818
53VTY.LSE13/06/20235753.8
54CSN.LSE13/06/202318283.3889
55LGEN.LSE13/06/202322238.1818
56PHNX.LSE13/06/20236553.5
57THRL.LSE13/06/20232275.1364
Sheet1
Cell Formulas
RangeFormula
L2:O57L2=LET( nm,tbl[Name], data,VSTACK(HSTACK(nm,tbl[[Date1]:[ShareCost1]]),HSTACK(nm,tbl[[Date2]:[ShareCost2]]),HSTACK(nm,tbl[[Date3]:[ShareCost3]])), SORT(FILTER(data,INDEX(data,,2)>0),2,1) )
Dynamic array formulas.
 
Upvote 0
@Georgiboy thanks for that it works, but being lazy I was looking for a solution that would automatically grow if the input table grows without me having to change the formula. Your solution does work perfectly and I will use it for the time being.

Thanks for your help

Ian
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFGHIJKLMNO
1NameDate1Shares1ShareCost1Date2Shares2ShareCost2Date3Shares3ShareCost3NameDateSharesCost
2BA..LSE12/05/2023105988.4022/05/2023-105988.40HLMA.LSE23/01/2023452141.64
3BATS.LSE13/03/2023453040.5016/05/2023352738.53SPX.LSE23/01/2023811543.60
4BME.LSE14/02/2023207476.6912/06/202328563.18BME.LSE14/02/2023207476.69
5CRDA.LSE12/05/2023136835.0022/05/2023-136835.00SGE.LSE27/02/2023130755.71
6CGS.LSE15/05/2023261376.50HLMA.LSE07/03/2023-452141.64
7CSN.LSE13/03/2023340284.0016/05/2023342286.6513/06/202318283.39SGE.LSE07/03/2023-130755.71
8DCC.LSE12/05/2023204732.50SPX.LSE07/03/2023-811543.60
9DGE.LSE12/05/202343528.25BATS.LSE13/03/2023453040.50
10GLEN.LSE13/03/2023378456.6016/05/2023225437.2405/06/202315435.86CSN.LSE13/03/2023340284.00
11GSK.LSE13/03/2023201387.0012/05/2023441481.90GLEN.LSE13/03/2023378456.60
12HLMA.LSE23/01/2023452141.6407/03/2023-452141.64GSK.LSE13/03/2023201387.00
13KETL.LSE13/03/202395692.80KETL.LSE13/03/202395692.80
14LGEN.LSE13/03/2023378241.3016/05/2023423231.9113/06/202322238.18LGEN.LSE13/03/2023378241.30
15LMP.LSE15/05/2023521188.47MNG.LSE13/03/2023471207.50
16MGNS.LSE22/05/2023521857.20MONY.LSE13/03/20231300232.40
17MNG.LSE13/03/2023471207.5016/05/2023492199.70NG..LSE13/03/2023911064.25
18MONY.LSE13/03/20231300232.4013/06/202342262.71PHNX.LSE13/03/2023153598.60
19NG..LSE13/03/2023911064.25PHP.LSE13/03/20231349100.60
20PHNX.LSE13/03/2023153598.6016/05/2023170575.3713/06/20236553.50PSN.LSE13/03/2023661217.25
21PHP.LSE13/03/20231349100.6013/06/202322100.82RIO.LSE13/03/2023315462.00
22PSN.LSE13/03/2023661217.25THRL.LSE13/03/2023120470.95
23RIO.LSE13/03/2023315462.0016/05/2023194966.50VOD.LSE13/03/2023204296.62
24SGE.LSE27/02/2023130755.7107/03/2023-130755.71VTY.LSE13/03/2023129762.25
25SPX.LSE23/01/2023811543.6007/03/2023-811543.60BA..LSE12/05/2023105988.40
26SRE.LSE15/05/2023126278.25CRDA.LSE12/05/2023136835.00
27THRL.LSE13/03/2023120470.9516/05/2023119082.5713/06/20232275.14DCC.LSE12/05/2023204732.50
28TND.LSE22/05/2023359247.20DGE.LSE12/05/202343528.25
29ULVR.LSE12/05/2023684340.00GSK.LSE12/05/2023441481.90
30UU..LSE12/05/2023931077.00ULVR.LSE12/05/2023684340.00
31VOD.LSE13/03/2023204296.6216/05/2023113786.4616/05/202351285.00UU..LSE12/05/2023931077.00
32VTY.LSE13/03/2023129762.2513/06/20235753.80CGS.LSE15/05/2023261376.50
33LMP.LSE15/05/2023521188.47
34SRE.LSE15/05/2023126278.25
35BATS.LSE16/05/2023352738.53
36CSN.LSE16/05/2023342286.65
37GLEN.LSE16/05/2023225437.24
38LGEN.LSE16/05/2023423231.91
39MNG.LSE16/05/2023492199.70
40PHNX.LSE16/05/2023170575.37
41RIO.LSE16/05/2023194966.50
42THRL.LSE16/05/2023119082.57
43VOD.LSE16/05/2023113786.46
44VOD.LSE16/05/202351285.00
45BA..LSE22/05/2023-105988.40
46CRDA.LSE22/05/2023-136835.00
47MGNS.LSE22/05/2023521857.20
48TND.LSE22/05/2023359247.20
49GLEN.LSE05/06/202315435.86
50BME.LSE12/06/202328563.18
51CSN.LSE13/06/202318283.39
52LGEN.LSE13/06/202322238.18
53MONY.LSE13/06/202342262.71
54PHNX.LSE13/06/20236553.50
55PHP.LSE13/06/202322100.82
56THRL.LSE13/06/20232275.14
57VTY.LSE13/06/20235753.80
Master
Cell Formulas
RangeFormula
L2:O57L2=LET(a,HSTACK(TOCOL(IF(SEQUENCE(,(COLUMNS(Table2)-1)/3),Table2[Name])),WRAPROWS(TOCOL(DROP(Table2,,1)),3)),SORT(FILTER(a,INDEX(a,,2)<>""),2))
Dynamic array formulas.
 
Upvote 1
Solution
Once again thanks @Fluff perfect solution and suits my lazy lifestyle and automatically expands as I add columns to the original table

Ian
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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