Convert unevenly spaced list to table [Data from Hell]

Share

Facebook
Twitter
LinkedIn

Introducing Data from Hell:

Watch out, its data from hell. In this new video series, we are going to look at some nutty, frustrating and fun data reshaping challenges and solve them using Excel. We will use Power Query, Formulas, VBA or other features as needed to free this data from damnation.

For our first installment, let’s reshape unevenly spaced list of values to a table.

Unevenly Spaced List -> Tabular format

Let’s say you have a list with some values. They are separated by blank cells. You want to convert this to a table, so related values are on same row. But the table can have any number of columns depending on how big the chunks are.

Something like this:

d4h-unevenly-spaced-list-to-table-power-query

Enter Power Query (Get & Transform Data)

You guessed right. This data is too much out of whack for formula based solution. So let’s reshape it using Power Query aka Get & Transform Data.

The process goes like this:

  1. Load the data in to query editor
  2. Replace nulls (blank cells) with something that is not part of your data, like %^%
  3. Using Text.Combine, concatenate all values to a single value, separated by some symbol that is not part of data, like =
  4. Convert this single value to a table and split by the symbol used in step 2.
  5. Calculate number of = symbols in each row using Text.Length and Text.Replace functions in to a new column
  6. Figure out the maximum of this new column as a variable. Name it as MaxCols
  7. Remove the extra column created in step 5
  8. Split the first column by delimiter set in step 3 with number of columns set to MaxCols.
  9. Load data back to Excel.

Data from Hell – Convert unevenly spaced list to table – Power Query tutorial

As this process requires a bit of tinkering with Power Query functions and a few false starts, I made a tutorial. I woke at 4AM to record this. Just kidding, I woke up because my nose was all blocked up and couldn’t go back to sleep. So I opened up Excel for some play and recorded this.  Check it out below.

You can also watch this video on our YouTube Channel.

Download Example Workbook

Click here to download the example workbook for this Power Query tutorial. Try reshaping the data yourself first, you will learn a lot about PQ and how to use it for your advantage.

More Power Query Recipes for you

Power Query (or Get & Transform Data as it is called in newer versions of Excel) is an incredibly powerful tool to extract, reshape and merge your data sets. Check out below tutorials and recipes for more.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

One Response to “Loan Amortization Schedule in Excel – FREE Template”

  1. Ag says:

    The balance formula as given doesnt seem to work on my excel

Leave a Reply