How to convert table into rows?

I have a spreadsheet with years (pop1970,pop1971, etc.) across the top and counties(state_county) down.
The intersection of each column and row is the population estimate for that state_county and year.
I need a macro that will create a row for each county_state and year and the population in this format:
county_state,year,population
Census-ExEx.xlsb
LVL 1
Alex CampbellAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
If you are using Excel-2010 or later, you may use Power Query, a free Add-In from Microsoft to get the data in the desired format.
Download it from the MS site and follow the instructions in the video to get the data in desired format.
The solution would be dynamic in nature i.e. if you add more data down the rows, all you need to do is right click on the new table created by Power Query and choose Refresh and it will be updated accordingly.
Census-ExEx.xlsb
RowsToColumns_PowerQuery.mp4
0
Matt NicholasBusiness AnalystCommented:
Hi Alex,

Attached using the solution from Subodh as above, check out Google and specifically "Unpivot Other Columns" function in Power Query.

You will love it!


M
Census-ExEx.xlsb
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
@Matt

It seems I misunderstood the requirement and assumed data on CompleteList as the desired output. My bad.


@ Alex
Please find the updated video to follow the steps to achieve the desired output. :)
Census-ExEx-v2.xlsb
RowsToColumns_PowerQuery.mp4
1
Alex CampbellAuthor Commented:
Thanks to both Matt and Subodh for an amazing tool in Excel.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Alex! Glad we could help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.