Two Dimensional Append?

kangelosanto

New Member
Joined
Aug 12, 2014
Messages
14
Hey All,

I've been stuck on this at work all day so turning here in my final hour of desperation!

I have two tables, listed below:

DateMonthProgramProjected Sales
1/1/20171ABC100
2/2/20172XYZ200
3/3/20173ABC300
4/4/20174XYZ400

<tbody>
</tbody>


Program123
ABC1.11.21.3
XYZ2.12.23.3

<tbody>
</tbody>


In the second table, the headers (1, 2, 3) are months, with the data set (1.1, 1.2, etc.) being modifiers we want to apply to our forecast. The problem is that these can change as frequently as weekly, so I need a way to add an additional column to the right of forecasted sales that is whatever the forecasted sale is multiplied by that month's modifier as according to the corresponding program, in a data table that's ~125,000 rows large. I know I could just run a vlookup(match()) function in a column to the right of the table but the table i'm referencing is linked to dozens of reporting workbooks and would need to have all the formulas updated.

Please help!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
You can unpivot table2 and then merge table1 with the unpivoted table2.

Table2Unpivot:
Code:
let
    Source = Table2,
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Program"}, "Month", "Value"),
    #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Month", Int64.Type}})
in
    #"Changed Type"

Final query:
Code:
let
    Source = Table.NestedJoin(Table1,{"Program", "Month"},Table2Unpivot,{"Program", "Month"},"Table2Unpivot",JoinKind.LeftOuter),
    #"Expanded Table2Unpivot" = Table.ExpandTableColumn(Source, "Table2Unpivot", {"Value"}, {"Value"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Table2Unpivot", "Multiplied", each [Projected Sales] * (if [Value] = null then 1 else [Value]))
in
    #"Added Custom"

I used 1 for missing multipliers like month 4 for XYZ.
 
Upvote 0

Forum statistics

Threads
1,215,260
Messages
6,123,926
Members
449,135
Latest member
NickWBA

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