Or more appropriately titled, the one where Power Query solves the problem in less time than it takes you to say Get & Transform Data.
Recently, one of my students Mr. K, sent me a pivot table problem.
Today my boss asked me “how much we paid to staff since the inception of our business with their respective date of joining?” He wanted to know, level wise summary of the last 16 years (on Quarterly / Year wise basis).
The records appended from the database month wise. Have a look to the file and give your ideas.
Mr. K’s data looked like this.

and his boss wanted a report like this:

What now?
The obvious solution – VLOOKUPs and patience
Even before I could go thru Mr. K’s problem and reply to him, he wrote back to me saying that he found the solution.
He used what I call as VLOOKUP and patience method. First he unpivoted original data using 233,000+ VLOOKUPs . Then he created a new pivot table from this unpivoted data to answer his boss’s questions.
While this method is fine, it consumes a lot of time and coffee.
A better solution – Power Query and pop corn
We, humans are not evolved to write two hundred thousand VLOOKUPs in afternoons. We are better at building powerful machines, watch them do bad ass work while we chew delicious pop corn.
So why not let the computer solve the problem?
Here is the ridiculously simple four step tutorial to get the same results.
- Load the data in to Power Query using From Table feature.
- Unpivot all the monthly data columns

- Load the data in to Excel as a new table

- Pivot it to create the report we need.

All this takes less than 15 seconds. Whenever you have new data, simply refresh the connection and everything (PQ, Pivot tables) gets updated.
Download the example workbook
Here is the workbook just in case you need to see everything. Please use Excel 2013 or above to play with this.
More power to you
Power Query is a truly remarkable feature of Excel. It saves you a lot of time and hassle. If you are new to Power Query (also known as Get & Transform data in Excel 2016), check out below tutorials to get started.
- Introduction to Power Query
- Import and work with web data using PQ
- Unpivot data with Power Query – an example
How would you solve this?
Prior to Power Query, I would have used VBA (as there is a lot of data) for something like this. For smaller data sets, I would have used VLOOKUPs.
What about you? What method would you use to rearrange data like this? Please share your tips in the comments section.

















6 Responses to “A quick personal update”
Thank you for the personal update. It was quite encouraging and a breath of fresh air in my Inbox. Take care and stay safe.
David
Doctors advise:
Virus obstructs lungs with thick mucus that solidifies.
Consume lot hot liquids like tea, soup, and sip of hot liquid every 20 min
Gargle w antiseptic of lemon, vinegar, & hot water daily
It attaches to hair/clothes detergent kills it, when come from st go straight shower
Hang dirty clothes in sunlight/cold overnight or wash immediately.
Wash metal surfaces as it can live on them 9 days
Do not touch hand rails
Do not smoke
Wash hands foaming 20 sec every 20 min
Eat fruit/veg and up zinc levels.
Animals do not spread it
Avoid common flu
Avoid eat/drink cold things
If feel sore throat do above immediate as virus is there 3-4 days before descends into lungs
Would love help with my database mgt in excel.
Thanks for being thoughtful of us.
BTW How do you track your expenses/income in excel? Can you share the worksheet please.
Stay safe you and your family, best wishes.
Thanks for the update and happy to know that you and family are doing good. A 21 day lockdown has now been announced in India (I live around Kolkata) so it's uncertain times ahead. I check up on your wonderful articles often and will do so even more regularly now. Stay safe and God bless.
Hi from Argentina, I follow you for a lot of years now. We here are in a quarantine for 2 or 3 weeks, because the pandemia.
Excel is also my passion and I came here looking for a Num2Words formula, but in spanish. If anyone have it, please let me know.
Best regards.
Pablo Molina
La Rioja - Argentina
I'm glad to have your personal update. I'm from India & following you for so many years. Cheers to have any further personal update.