I have an Excel sheet with headings for 'Year' and 'Make of Car'. However, under each of the 'Make of Car' headings, there are the subheadings 'Cost Price', 'Selling Price' and 'Total Sales'.
Please see example below:
I am wanting the final output to only have the headings:
- Model Year
- Make of Car
- Cost Price
- Selling Price
- Total Sales
Please see desired final output below:
I have attempted to do this with with the following steps:
1) Rename all the 'Cost Price' columns to the car make. For example, the cost price column for Ford has been renamed to 'Ford'.
2) Unpivot / convert columns into rows of keys (car make) and values (cost price)
3) Repeat steps 1 and 2 for both Selling Price and Total Sales
This however leaves me with duplicate 'Make of Car' columns. I can find a way to filter these so that only the relevant ones show, but I feel like there is probably a less tedious way to do this transformation.
Some help would be much appreciated!