Transpose large amount of data

Thoron6

New Member
Joined
Oct 27, 2015
Messages
27
Morning,

I have a file in the following format:

Serial number | Date/Time | Data
123 01/08/2017 00:30 3.2
123 01/08/2017 01:00 2.5
123 01/08/2017 01:30 3.1
456 01/08/2017 00:30 6
456 01/08/2017 01:00 6.5

I have data for each half hour of every day in a set period so the file is over a millions rows.

I would like the data in the following format:

Serial number | Date | 00:30 | 01:00 | 01:30
123 01/08/2017 3.2 2.5 3.1
123 02/08/2017 etc etc
123 03/08/2017

IS there a formula that can be used to do this?

Thank you
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try Power Query , convert your data into a table & import to Power Query & Paste the following Code in the advanced editor

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Serial number ", Int64.Type}, {" Date/Time ", type datetime}, {" Data", type number}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", " Date/Time ", " Date/Time  - Copy"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Duplicated Column",{{" Date/Time ", type date}, {" Date/Time  - Copy", type time}}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Changed Type1", {{" Date/Time  - Copy", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Changed Type1", {{" Date/Time  - Copy", type text}}, "en-US")[#" Date/Time  - Copy"]), " Date/Time  - Copy", " Data", List.Sum)
in
    #"Pivoted Column"
 
Last edited:
Upvote 0
Thanks for the quick response, However, I dont have access to power query. Is there a way to do this with formulas o VB?

Thank you
 
Upvote 0
No Mate with formula it would be very messy & complicated. May be someone else can assist you with VB as it would be easier that way
 
Upvote 0
Can you use something like this? This involves two different formulas. Use the first formula to get answers for the numbers and dates. Use Cntr+Shift+Enter. Copy down and across. Check the $'s in the formula. The formula is
=IFERROR(INDEX(A$2:A$6,SMALL(IF(FREQUENCY(IF($A$2:$A$6<>"",MATCH($A$2:$A$6&$B$2:$B$6,$A$2:$A$6&$B$2:$B$6,0)),ROW($A$2:$A$6)-ROW($A$2)+1),ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($A$9:A9)))," ")

The second formula for is for the data. Use Cntrl+Shift+Enter. Also check your $'s in the formula. Copy down and accross. The formula is
=IFERROR(INDEX($D$2:$D$6,SMALL(IF($A$2:$A$6=$A$9,IF($B$2:$B$6=$B$9,IF($C$2:$C$6=C$8,ROW($D$2:$D$6)-ROW($D$2)+1))),1))," ")



<tbody>
</tbody>

<tbody>
</tbody>
NumberDate0:301:001:30
1231/8/20173.22.5
1231/9/20173.1
4561/8/201766.5

<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,945
Members
449,275
Latest member
jacob_mcbride

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