J
jd
Hi, I've foolishly volunteered to help someone out with flattening a
number of database tables into a single spreadsheet, and my minor
level of Excel knowledge is hindering me in what I'd think would be a
simple task.
To illustrate my problem consider the following tables (might look
better in a fixed width font)
ID Name Fruits
1 James
2 Paul
3 Frances
A list of Names and their corresponding Identifiers, obviously. And an
empty column labeled 'fruits'.
Then, we have another table which maps the various person-IDs to the
fruit they like...
ID Fruit
1 Apple
1 Pear
1 Orange
2 Apple
2 Orange
3 Pear
....so, for example, James likes apples and pears, while Frances only
likes pears.
I'd ideally like the Fruits column in the first table to contain some
string contatonation of the various fruits that person likes,
something similar to the following:
ID Name Fruits
1 James Apple,Pear,Orange
2 Paul Apple,Orange
3 Frances Pear
If this was stored in a database, I'd have no trouble getting the data
with SQL, and no problem if it was in some kind of multi-dimensional
array in C or C#, but using Excel formulas, I'm completely stumped.
So far I've tried playing around with LOOKUP, and VLOOKUP, some stuff
with CELL, and some IFs. Is there anyone that can suggest just the
name of some functions I should be looking at?
Many thanks in advance.
JD
number of database tables into a single spreadsheet, and my minor
level of Excel knowledge is hindering me in what I'd think would be a
simple task.
To illustrate my problem consider the following tables (might look
better in a fixed width font)
ID Name Fruits
1 James
2 Paul
3 Frances
A list of Names and their corresponding Identifiers, obviously. And an
empty column labeled 'fruits'.
Then, we have another table which maps the various person-IDs to the
fruit they like...
ID Fruit
1 Apple
1 Pear
1 Orange
2 Apple
2 Orange
3 Pear
....so, for example, James likes apples and pears, while Frances only
likes pears.
I'd ideally like the Fruits column in the first table to contain some
string contatonation of the various fruits that person likes,
something similar to the following:
ID Name Fruits
1 James Apple,Pear,Orange
2 Paul Apple,Orange
3 Frances Pear
If this was stored in a database, I'd have no trouble getting the data
with SQL, and no problem if it was in some kind of multi-dimensional
array in C or C#, but using Excel formulas, I'm completely stumped.
So far I've tried playing around with LOOKUP, and VLOOKUP, some stuff
with CELL, and some IFs. Is there anyone that can suggest just the
name of some functions I should be looking at?
Many thanks in advance.
JD