Dynamically populate columns based on rows

Steve_K

Board Regular
Joined
Dec 23, 2011
Messages
187
Hi all,

My goal is to be able to take one format of sheet and, based on it, create another. Here's an example:

I have the following sheet which is a sheet I get from a source whose format I cannot control:

ABCDEFG
FooBarBallBazAAABBB...
Value 1Value 2Value 3Value 4Value XValue Y...

<tbody>
</tbody>

I need to create a new sheet which translates the values above into the values I actually need and then populate the sheet accordingly. I figure I could use a "conversion" sheet for this -- something like:

AB
Fooname
Bardescription
Ballprice
Bazcolor
AAAband_size
BBBband_material

<tbody>
</tbody>

This translation sheet would populate a third "result" sheet like so

ABCDEF
namedescriptionpricecolorband_sizeband_material
Value 1Value 2Value 3Value 4Value XValue Y

<tbody>
</tbody>

The idea here is that I could copy and paste columns and rows from Sheet 1, have them dynamically populate column A in sheet 2. Then I'd fill in column B in sheet 2. Next, the header row of sheet 3 is populated from the values I entered in column B, along with the matching values in the associated columns from Sheet 1.

I keep thinking this should be some kind of INDEX and MATCH thing and definitely not nested IFs. Maybe SUMPRODUCT?

Thanks for reading -- any help or guidance on how I can achieve this is greatly appreciated.
 
Last edited:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
it would help if your first table had name,description etc OR does the data really say foo
 
Upvote 0
A
BCDEFG
FooBarBallBazAAABBB...
Value 1Value 2Value 3Value 4Value XValue Y...
A
B
AAAband_sizex
Ballpricex
Bardescriptionx
Bazcolorx
BBBband_materialx
Foonamex
A
BCDEF
namedescriptionpricecolorband_sizeband_material
Value 1Value 2Value 3Value 4Value XValue Y
namedescriptionpricecolorband_sizeband_material
Value 1Value 2Value 3Value 4Value XValue Y
formula translating foo into name is
=VLOOKUP(A4,mytable2,2)
a10 to b15 (marked x) is called mytable2

<colgroup><col><col><col span="2"><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
Thanks for the reply! I wanted to show that the values in the first sheet can be anything -- there's no pattern or connection. Does that affect your solution?
 
Upvote 0
I'd like to ask for a bit more clarification as I'm not following as well as I know I should be.

For your VLOOKUP statement above, can you describe the relationship between my three proposed tables? Is the "A4" coming from the first table or the second? I'm assuming we're looking for A4 from table 1 and seeing if there's a match from table 2. If there is, are we then pulling the column data from table 1 and spitting it out in table 3?

Thanks again for the insight and help.
 
Upvote 0
Upvote 0
to get name i look up A4 (foo) in the second table bringing back the word in column 2, to get value 1 under name I just use =A5

it is not a transposition imho
 
Upvote 0
Thank you both - I can see the merit in both solutions. The VLOOKUP works best in this case for me.
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,634
Members
449,460
Latest member
jgharbawi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top