MrMishutka
New Member
- Joined
- Feb 6, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- MacOS
To take a table such as this
And turn it into a table like this
Is pretty easy in Power Query
But does anyone know how to do this with dynamic array formulae? I have been trying with a combination of BYROW, SEQUENCE and TOCOL, but keep geeting a #VALUE error because it says I have nested arrays.
I got close with a list of dates using in cell I2
where H2 contained
I could copy this down against each row in the table and then use
but the problem with this it is not dynamic and has to be updated everytime a new record is added to the table, in which case I might as well use the simple Power Query method above.
I tried to change H2 to H2# throughout the formula and I get a #VALUE! error. Equally if I change I2 to
I get a #CALC! (Nested Arrays) error.
Does anyone have any suggestions how I can get a proper data set using dynamic array formulae?
And turn it into a table like this
Is pretty easy in Power Query
Power Query:
let
Source = Excel.CurrentWorkbook(){[Name="BaseData"]}[Content],
#"Changed column type" = Table.TransformColumnTypes(Source, {{"Start", type date}, {"End", type date}, {"Type", type text}, {"Description", type text}}),
#"Added number of days" = Table.AddColumn(#"Changed column type", "Days", each Duration.Days([End] - [Start]), Int64.Type),
#"Add list" = Table.AddColumn(#"Added number of days", "List", each {0..[Days]}),
#"Expanded list" = Table.ExpandListColumn(#"Add list", "List"),
#"Added dates" = Table.AddColumn(#"Expanded list", "Date", each Date.AddDays([Start],[List]), type date),
#"Removed other columns" = Table.SelectColumns(#"Added dates", {"Date", "Type", "Description"})
in
#"Removed other columns"
I got close with a list of dates using in cell I2
Excel Formula:
=SEQUENCE(1,OFFSET(BaseData,H2-1,1,1,1)-OFFSET(BaseData,H2-1,0,1,1)+1,OFFSET(BaseData,H2-1,0,1,1),1)
Excel Formula:
=SEQUENCE(ROWS(BaseData))
I could copy this down against each row in the table and then use
Excel Formula:
=TOCOL(I2#:I4#,1)
I tried to change H2 to H2# throughout the formula and I get a #VALUE! error. Equally if I change I2 to
Excel Formula:
=BYROW(H2#,LAMBDA(r,SEQUENCE(1,OFFSET(BaseData,r-1,1,1,1)-OFFSET(BaseData,r-1,0,1,1)+1,OFFSET(BaseData,r-1,0,1,1),1)))
Does anyone have any suggestions how I can get a proper data set using dynamic array formulae?