2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Power Query Help Merging Spreadsheets with Compound Headers

I've been using Power Query to combine tables from multiple workbooks. It's fairly straightforward when every worksheet has exactly the same headers in exactly the same order in the top row. However, I'm trying to merge many different spreadsheets which have "compound headers," meaning each column's unique identifier is the top 4 rows. (Row 1 is the result type, Row 2 is the Cycle Number, Row 3 is the Analyte Name, and Row 4 is the Unit.) To complicate things even more, not every spreadsheet contains data for all the same headers, because sometimes we don't test all the same chemicals, and sometimes we don't test in the same units. See an example of just 4 of the worksheets I'm working with here: https://drive.google.com/drive/folders/1iZpvy7OSmltpduB0DdGKoGRTysHXHu_j?usp=sharing

I've deleted all the actual data and replaced it with a blue block, but you can see the layout. I'd like to preserve all the data in the resulting merge. In other words, I don't want to only keep columns that exist in every spreadsheet. I want to keep all columns that appear at least once. The end goal is to be able to filter the table to find all the samples named "CCV" or "RLV" for example and trend their respective data. (We don't always include the data in the sample name in Column B, so adding a column for the source file name would be necessary as well, so that we know which date the data is for.)

Please let me know how I might do this with Power Query, or if there's a better way. We have dozens of these files, and we'd really like to avoid copying and pasting all day.

Thanks so much for the help.

submitted by /u/7Xe3V7Ur
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#generative AI for data analysis
#big data management in spreadsheets
#natural language processing for spreadsheets
#conversational data analysis
#real-time data collaboration
#intelligent data visualization
#data visualization tools
#enterprise data management
#big data performance
#data analysis tools
#data cleaning solutions
#row zero
#financial modeling with spreadsheets
#rows.com
#modern spreadsheet innovations
#machine learning in spreadsheet applications
#enterprise-level spreadsheet solutions
#digital transformation in spreadsheet software
#collaborative spreadsheet tools