April 4, 2019
I have an excel workbook that I've created for collecting cash-flow forecasts for projects. The workbook has tables (not formatted as tables) that are setup with categories listed vertically in one column, months listed horizontally in each subsequent column with dollars input at the intersection of the two. This makes data entry easy but data extraction for analysis difficult. I've been able to get it to work by using complicated index/match formulas (e.g. "=IF(A1640>B1640,IFERROR(INDEX(INDIRECT(C1640&"!E64:AB64"),1,MATCH(B1640,INDIRECT(C1640&"!E38:AB38"))),"0"),IFERROR(INDEX(INDIRECT(C1640&"!E45:AB45"),1,MATCH(B1640,INDIRECT(C1640&"!E38:AB38"))),"0"))"), but there are significant limitations to this approach. I recently watched a video on how to consolidate data across sheets using PowerQuery, but the data in the sheets in that video was already in a "friendly" format. Any tips on how to setup a table for easy data entry by the user while simultaneously making it easy to extract the data for analysis and reporting?
July 16, 2010
Hi Eric,
You can use Power Query to append the data on each worksheet, if they have the same column headers, or merge if the column headers are different. Then you can unpivot the data so the months are in a column and the values in another column. That way the data will be in the correct tabular format for analysing with PivotTables or formulas and you won't need to use complex and error prone formulas like the one above 🙂
I hope that points you in the right direction.
Mynda
April 4, 2019
Thanks Mynda. That worked...sort of. I was able to append the data and then unpivot once but when I added another column to the end of the original table, the query did not pick up the new column. I noticed on your unpivot data video that you added new data "inside" the original table, meaning there were columns on either side of the new column. Is that necessary? Also, I noticed your column header automatically incremented (from 2015 to 2016 in the first example). First, is that necessary for the query to pick up the new data and second, how did you do that? When I add a new column, it just copies the previous column's header and I have to manually change it.
July 16, 2010
Hi Eric,
When you unpivot, instead of selecting the columns to unpivot, select the columns you don't want to unpivot and then select 'Unpivot Other Columns'. This will ensure any new columns will be included.
Hopefully that will fix the subsequent problem, but let me know if not.
Mynda
1 Guest(s)