Total Numbers From Data Alt-Entered
February 23, 2023 - by Bill Jelen
Problem: I work for a bunch of people who don't know how to use Excel. They insist on treating an Excel like it is Microsoft Word, using Alt+Enter to put multiple things in one cell.
Strategy: Power Query can handle this. The Split Column feature, which started out similar to Text to Columns in Excel has a new twist: it can split a cell and move each value to a new row instead of a new column.
Follow these steps:
1. Format the original data as a table using Ctrl+T
-
2. On the Data Tab, choose From Table/Range. Wait for the Power Query Editor to load.
3. Select the Amounts column in Power Query. On the Home tab, choose Split Column, By Delimiter.
4. For the delimiter, choose Custom. Leave the delimiter box empty for now.
5. Open the Advanced Options.
6. Choose to Split Into Rows
7. Choose the box for Split Using Special Characters.
8. Click into the Delimiter box. Use the Insert Special Character drop-down and choose Linefeed. Power Query inserts a code for linefeed inthe delimiter box.
9. Click OK.
At this point, the data is half clean..
Choose the Amounts column and Split Column by Delimiter of " - ". You now have three columns.
While you are likely happy at this point and ready to head back to Excel, you can further summarize the data in Power Query.
Choose the Cost Center column. On the Transform tab, choose Group By. Fill out the Group By dialog as shown:
After you close and load, you will end up with a new worksheet with a summary by cost center.
Any time that you type new numbers in the original data, use the Refresh icon to update the summary table.
This article is an excerpt from Power Excel With MrExcel
Title photo by Volodymyr Hryshchenko on Unsplash