Looking for a Formula / VBA that adds and transposes project cost and phase items

kabutocat

New Member
Joined
Nov 30, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
So I have a table that has the following
PhaseCodeDescriptionCost
Preliminary Phase
A1Liaison$ 3,000.00
A2Project Meeting$ 2,000.00
B1Financial Modelling$ 1,000.00
C1Project Management$ 1,000.00
Main Phase
A1Liaison$ 5,000.00
A2Project Meeting$ 4,000.00
B1Financial Modelling$ 2,000.00
C1Project Management$ 3,000.00
End Phase
etc

I'm looking for a formula or VBA that would output the following
CodeDescriptionPreliminary PhaseMain PhaseEnd Phase
A1Liaison$ 3000.00$ 5000.00etc.
A2Project Meetingetcetc
B1Financial Modelling
C1Project Management

It would be preferred if the formula / vba can be flexible with additional items and phases.
Thank you.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Power Query Solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Filled Down" = Table.FillDown(Source,{"Phase"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Code] <> null)),
    #"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Phase", type text}, {"Code", type text}, {"Description", type text}, {"Cost", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Phase]), "Phase", "Cost")
in
    #"Pivoted Column"

Book8
ABCDEFGHI
1PhaseCodeDescriptionCostCodeDescriptionPreliminary PhaseMain Phase
2Preliminary PhaseA1Liaison30005000
3A1Liaison$3,000.00A2Project Meeting20004000
4A2Project Meeting$2,000.00B1Financial Modelling10002000
5B1Financial Modelling$1,000.00C1Project Management10003000
6C1Project Management$1,000.00
7Main Phase
8A1Liaison$5,000.00
9A2Project Meeting$4,000.00
10B1Financial Modelling$2,000.00
11C1Project Management$3,000.00
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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