One possible way with Power Query since your data is not in a normalized presentation.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Transposed Table" = Table.Transpose(Source),
#"Merged Columns" = Table.CombineColumns(#"Transposed Table",{"Column1", "Column2"},Combiner.CombineTextByDelimiter(":", QuoteStyle.None),"Merged"),
#"Transposed Table1" = Table.Transpose(#"Merged Columns"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
#"Filtered Rows" = Table.SelectRows(#"Promoted Headers", each ([#":INCOME"] = "TOTAL INCOME")),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{":TYPE", ":TREND"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {":INCOME"}, "Attribute", "Value"),
#"Filtered Rows1" = Table.SelectRows(#"Unpivoted Other Columns", each not Text.Contains([Attribute], "VAR")),
#"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each not Text.Contains([Attribute], "%")),
#"Filtered Rows3" = Table.SelectRows(#"Filtered Rows2", each ([Attribute] = "APRIL:ACTUAL" or [Attribute] = "AUGUST:ACTUAL" or [Attribute] = "DECEMBER:BUDGET" or [Attribute] = "FEBRUARY:BUDGET" or [Attribute] = "JANUARY:BUDGET" or [Attribute] = "JULY:ACTUAL" or [Attribute] = "JUNE:ACTUAL" or [Attribute] = "MARCH:BUDGET" or [Attribute] = "MAY:ACTUAL" or [Attribute] = "NOVEMBER:BUDGET" or [Attribute] = "OCTOBER:ACTUAL" or [Attribute] = "SEPTEMBER:ACTUAL")),
#"Removed Columns1" = Table.RemoveColumns(#"Filtered Rows3",{":INCOME"}),
#"Transposed Table2" = Table.Transpose(#"Removed Columns1"),
#"Promoted Headers1" = Table.PromoteHeaders(#"Transposed Table2", [PromoteAllScalars=true])
in
#"Promoted Headers1"
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").
It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.
- Follow this link to learn how to install Power Query in Excel 2010 / 2013.
- Follow this link for an introduction to Power Query functionality.
- Follow this link for a video which demonstrates how to use Power Query code provided.
Bookmarks