List data horizontally from table based on date

Tipsey

New Member
Joined
Oct 28, 2022
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have a table with orders in it and I would like to generate the desired output based on the return date using excel formulas and not VB.

Thanks in advance for any help you can provide.

Return Tracker.xlsx
ABCDEFGHIJKL
1NumberNameOrder DateReturn DateDesired OutputNumberNameReturn 1Return 2Return 3
21Bob12-Jan29-Jan1Bob29-Jan28-Feb
32Charlie4-Feb1-Mar2Charlie27-Feb1-Mar6-Mar
43Doug5-Feb3Doug
52Charlie20-Feb4Ray7-Mar
62Charlie21-Feb
71Bob22-Feb28-Feb
83Doug22-Feb
92Charlie25-Feb27-Feb
101Bob28-Feb
114Ray1-Mar7-Mar
122Charlie1-Mar6-Mar
133Doug2-Mar
14
Sheet1
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
How about
Fluff.xlsm
ABCDEFGHIJKL
1NumberNameOrder DateReturn DateDesired OutputNumberNameReturn 1Return 2Return 3
21Bob45303453201Bob4532045350
32Charlie45326453522Charlie453524534945357
43Doug453273Doug 
52Charlie453424Ray45358
62Charlie45343
71Bob4534445350
83Doug45344
92Charlie4534745349
101Bob45350
114Ray4535245358
122Charlie4535245357
133Doug45353
Data
Cell Formulas
RangeFormula
H2:I5H2=UNIQUE(A2:B13)
J2:K2,J4:J5,J3:L3J2=TOROW(FILTER($D$2:$D$13,($D$2:$D$13<>"")*($A$2:$A$13=H2),""))
Dynamic array formulas.
 
Upvote 0
An alternative with Power Query
Book3
ABCDEFGHIJK
1NumberNameOrder DateReturn Date
21Bob453031/29/2024NumberNameReturn 1Return 2Return 3
32Charlie453263/1/20241Bob4530345344
43Doug453272Charlie453264534745352
52Charlie453424Ray45352
62Charlie45343
71Bob453442/28/2024
83Doug45344
92Charlie453472/27/2024
101Bob45350
114Ray453523/7/2024
122Charlie453523/6/2024
133Doug45353
Sheet1


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Filtered Rows" = Table.SelectRows(Source, each ([Return Date] <> null)),
    #"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Return Date", type date}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Name"}, {{"Count", each _, type table [Number=number, Name=text, Order Date=number, Return Date=nullable date]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Count],"Index",1,1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Count"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Number", "Order Date", "Return Date", "Index"}, {"Number", "Order Date", "Return Date", "Index"}),
    #"Removed Columns1" = Table.RemoveColumns(#"Expanded Custom",{"Return Date"}),
    #"Added Prefix" = Table.TransformColumns(#"Removed Columns1", {{"Index", each "Return " & Text.From(_, "en-US"), type text}}),
    #"Pivoted Column" = Table.Pivot(#"Added Prefix", List.Distinct(#"Added Prefix"[Index]), "Index", "Order Date"),
    #"Reordered Columns" = Table.ReorderColumns(#"Pivoted Column",{"Number", "Name", "Return 1", "Return 2", "Return 3"})
in
    #"Reordered Columns"
 
Upvote 0
misread and mixed up the order data and return data. Apologies.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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