I have an Excel sheet that has a few hundred sets of mapping tables all stacked on top of one another, and would like to split each table out into its own sheet. The data is structured like so:
Table 1 | Mapped Table 1 |
1 | Apple |
2 | Orange |
3 | Pear |
Table 2 | Mapped Table 2 |
1 | Blue |
2 | Red |
Table 3 | Mapped Table 3 |
1 | New York |
2 | California |
3 | Illinois |
4 | Florida |
The big thing to note here is that the length of each table is not consistent, but each table is separated by a blank row. Ideally Tables 1, 2, and 3 will each have their own new Excel sheets, positioned to sit in columns A and B within that sheet.
Appreciate any possible help in advance!
Solved! Go to Solution.
See solution:
- Name fields A and B
- Data Cleansing to make sure the empty rows are completely empty
- Multi-Row Formula to assign numbers to every sheet everytime a blank row is seen.
- Creates name of the Sheet. Sheet + Number
- Filter empty rows and rows that contain "Table". I guessed you wanted to take these rows out.
- Output to Excel - You check the option "Change File/Table Name" and select the field with Sheet Numbers to do that.
See if it works for you. You may need to change the Output path to try your own version.
Cheers,
Thanks Thableaus! This is super helpful and almost exactly gets me what I need. Two follow-up questions though:
1. I forgot to mention, the tables also have a sub-heading that shows the Type of data - the wording in column A is always the exact same. Is there an easy way to remove these rows (by looking up entries that say 'Type:' ?)
Table 1 | Mapped Table 2 |
Type: | String |
1 | Apple |
2 | Orange |
3 | Pear |
2. In the output of each sheet, I'd like to keep Table 1 and Mapped Table 2 as the headers in Row 1. I figured out how to include them, but I was still pulling in A and B the row above. Is there any way to not include the Field headers as the first row in each output sheet?
1) You can get rid of "Type" rows by doing the same thing I did with Table. "Contains([A], "Type")" in the Filter Tool
2) Quickest workaround I found was to rename fields "A" and "B" to whitespaces. A became 1 whitespace and B became 2 whitespaces.
If you needed different headers (different schema), I'd suggest a building a macro.
New WF appended.
Cheers,