Hi all,
I've been working through some challenges and have a pretty ambitious goal here. Something tells me it may not be possible with formulas, but I remain hopeful.
I'd like to take the columns from one sheet and map them to other values in another sheet while also being able to re-order them into a different column order and to include "new" columns not in the original set as well. Here's an example of the goal.
On one sheet, I have the following range of source data:
Source Data Set
[TABLE="class: grid, width: 750"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product Type[/TD]
[TD]Code[/TD]
[TD]Name[/TD]
[TD]Brand[/TD]
[TD]Price[/TD]
[TD]Cost[/TD]
[TD]Description[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]P[/TD]
[TD]XSJDHU-01[/TD]
[TD]Kukla Stylish Shades[/TD]
[TD]Kukla[/TD]
[TD]$3,000[/TD]
[TD]$750[/TD]
[TD]Great shades[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]P[/TD]
[TD]KDW-001s[/TD]
[TD]Kukla Deluxe Watch[/TD]
[TD]Kukla[/TD]
[TD]$500[/TD]
[TD]$100[/TD]
[TD]Awesome watch[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]P[/TD]
[TD]SKQOD-10[/TD]
[TD]Kukla Stylish Hoodie[/TD]
[TD]Kukla[/TD]
[TD]$320[/TD]
[TD][/TD]
[TD]Really comfortable[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]P[/TD]
[TD]SKDWJ-102[/TD]
[TD]Kukla Sports Watch[/TD]
[TD]Kukla[/TD]
[TD]$350[/TD]
[TD]$50[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
A couple points about this data:
What I now need to do is to get the above data into a custom format in another sheet. More specifically, I need to:
As an example:
Result Data Set
[TABLE="class: grid, width: 1000"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]_type[/TD]
[TD]sku[/TD]
[TD]name[/TD]
[TD]brand[/TD]
[TD]price[/TD]
[TD]description[/TD]
[TD]custom_1[/TD]
[TD]another_custom[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]XSJDHU-01[/TD]
[TD]Kukla Stylish Shades[/TD]
[TD]Kukla[/TD]
[TD]$3,000[/TD]
[TD]Great shades[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD]KDW-001s[/TD]
[TD]Kukla Deluxe Watch[/TD]
[TD]Kukla[/TD]
[TD]$500[/TD]
[TD]Awesome watch[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD]SKQOD-10[/TD]
[TD]Kukla Stylish Hoodie[/TD]
[TD]Kukla[/TD]
[TD]$320[/TD]
[TD]Really comfortable[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]SKDWJ-102[/TD]
[TD]Kukla Sports Watch[/TD]
[TD]Kukla[/TD]
[TD]$350[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In this data transformation, the following has taken place:
Regarding the last point above, I haven't even begun to figure out how to do the appending of the two custom fields with their values, so I can amend that requirement to say that I should have the ability to add custom headers with blank row values. (Exactly as what would be necessary for A:A in the result set above)
In thinking through the connections here, the only thing I can think of is some kind of "conversion" sheet for the source and result sheets. Something like this:
Conversion Table
[TABLE="class: grid, width: 350"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Source Header[/TD]
[TD]Result Header[/TD]
[TD]Blank[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Product Type[/TD]
[TD]_type[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Code[/TD]
[TD]sku[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Name[/TD]
[TD]name[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Brand[/TD]
[TD]brand[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Price[/TD]
[TD]price[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Cost[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Description[/TD]
[TD]description[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD]custom_1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD]another_custom[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In this "conversion table," we do the following:
Whew - long one, but I hope I've explained the goal thoroughly and clearly. To this point, I've been experimenting with TRANSPOSE() and INDEX and MATCH combinations with only partial success. The main limitations of each have been:
I am relatively convinced that this is possible and that I simply am not advanced enough to grasp it. I would appreciate any and all help, and I thank you in advance for taking the time to read this novella here.
I've been working through some challenges and have a pretty ambitious goal here. Something tells me it may not be possible with formulas, but I remain hopeful.
I'd like to take the columns from one sheet and map them to other values in another sheet while also being able to re-order them into a different column order and to include "new" columns not in the original set as well. Here's an example of the goal.
On one sheet, I have the following range of source data:
Source Data Set
[TABLE="class: grid, width: 750"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Product Type[/TD]
[TD]Code[/TD]
[TD]Name[/TD]
[TD]Brand[/TD]
[TD]Price[/TD]
[TD]Cost[/TD]
[TD]Description[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]P[/TD]
[TD]XSJDHU-01[/TD]
[TD]Kukla Stylish Shades[/TD]
[TD]Kukla[/TD]
[TD]$3,000[/TD]
[TD]$750[/TD]
[TD]Great shades[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]P[/TD]
[TD]KDW-001s[/TD]
[TD]Kukla Deluxe Watch[/TD]
[TD]Kukla[/TD]
[TD]$500[/TD]
[TD]$100[/TD]
[TD]Awesome watch[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]P[/TD]
[TD]SKQOD-10[/TD]
[TD]Kukla Stylish Hoodie[/TD]
[TD]Kukla[/TD]
[TD]$320[/TD]
[TD][/TD]
[TD]Really comfortable[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]P[/TD]
[TD]SKDWJ-102[/TD]
[TD]Kukla Sports Watch[/TD]
[TD]Kukla[/TD]
[TD]$350[/TD]
[TD]$50[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
A couple points about this data:
- Any field can contain any value; there are no connections between the data in these cells
- This source data may or may not contain the same or a unique set of columns of any number
- The column order may or may not be constant across source data sets
- Some of the data may or may not have blanks (see F4, for example)
What I now need to do is to get the above data into a custom format in another sheet. More specifically, I need to:
- Choose which columns I want to transfer
- Map the column names in the above sheet to names of my choosing
- Have the ability to leave out columns from the source data set so they're completely ignored in the result set
- Have the ability to include a custom column header mapped from a source header without including source data beneath it
- Have the ability to include new columns into the result set which I will fill in manually
As an example:
Result Data Set
[TABLE="class: grid, width: 1000"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]_type[/TD]
[TD]sku[/TD]
[TD]name[/TD]
[TD]brand[/TD]
[TD]price[/TD]
[TD]description[/TD]
[TD]custom_1[/TD]
[TD]another_custom[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]XSJDHU-01[/TD]
[TD]Kukla Stylish Shades[/TD]
[TD]Kukla[/TD]
[TD]$3,000[/TD]
[TD]Great shades[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD]KDW-001s[/TD]
[TD]Kukla Deluxe Watch[/TD]
[TD]Kukla[/TD]
[TD]$500[/TD]
[TD]Awesome watch[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD]SKQOD-10[/TD]
[TD]Kukla Stylish Hoodie[/TD]
[TD]Kukla[/TD]
[TD]$320[/TD]
[TD]Really comfortable[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]SKDWJ-102[/TD]
[TD]Kukla Sports Watch[/TD]
[TD]Kukla[/TD]
[TD]$350[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In this data transformation, the following has taken place:
- The column headers have been mapped like so:
- Product Type --> _type
- Code --> sku
- Name --> name
- Brand --> brand
- Price --> price
- Description --> description
- Although the "Product Type"'s column header has been renamed and that column has been transferred to the result data set, it's values from the source data set have not been transferred
- The entire "Cost" column from the source data set (F) has been removed (e.g. not transferred) to the result set
- The "Description" value in the source data set at G5 has been intentionally left blank in the source data set and kept blank in the result set
- The fields "custom_1" and "another_custom" have been included in the result data set as column headers with no values
Regarding the last point above, I haven't even begun to figure out how to do the appending of the two custom fields with their values, so I can amend that requirement to say that I should have the ability to add custom headers with blank row values. (Exactly as what would be necessary for A:A in the result set above)
In thinking through the connections here, the only thing I can think of is some kind of "conversion" sheet for the source and result sheets. Something like this:
Conversion Table
[TABLE="class: grid, width: 350"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Source Header[/TD]
[TD]Result Header[/TD]
[TD]Blank[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Product Type[/TD]
[TD]_type[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Code[/TD]
[TD]sku[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Name[/TD]
[TD]name[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Brand[/TD]
[TD]brand[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Price[/TD]
[TD]price[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Cost[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Description[/TD]
[TD]description[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD]custom_1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD]another_custom[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In this "conversion table," we do the following:
- Read in the columns from the source data set into A:A
- User fills in value for "Result Header" which is used in the result table
- If both the "Source Header" and "Result Header" fields are filled and the "Blank" column is marked, the Source Header value is converted into the Result Header value and included in the result data set; however, none of its values are transferred
- If the "Source Header" field is filled in but the "Result Header" field is blank, that "Source Header" column should be excluded entirely from the result data set
- If the "Source Header" field is blank but the "Result Header" field is filled, this indicates a manually-defined "custom field" column header which would not be present in the source data, but would be included in the result data set.
Whew - long one, but I hope I've explained the goal thoroughly and clearly. To this point, I've been experimenting with TRANSPOSE() and INDEX and MATCH combinations with only partial success. The main limitations of each have been:
- TRANSPOSE is limited by its need for a fully-defined array. I need to be able to include a variably-sized source data set
- INDEX and MATCH cannot seem to map the "horizontal-to-vertical-to-horizontal" approach in order to maintain the relationships between the source data and the converted data.
I am relatively convinced that this is possible and that I simply am not advanced enough to grasp it. I would appreciate any and all help, and I thank you in advance for taking the time to read this novella here.
Last edited: