PDA

View Full Version : Sorting Data by keywords



rrtts
10-25-2006, 07:03 PM
Anybody else have this problem...seems like there are hundreds of ways for Excel to achieve the desired results...and it never fails, once I get help or figure out how to do something...I think of a different way I should've done it.

Okay...here's my real problem.

Lets say I have the following data - each entry in a single cell.

GeoLoc1/Unit Name1
GeoLoc2/Unit Name2

Now, lets say GeoLoc1 = UK and GeoLoc2 = USA.

I'm trying to get these results - in two cells.

Unit Name1 | UK
Unit Name2 | USA

There will be about 30 to 40 individual Unit Names and almost as many GeoLoc...although the Unit Names may share GeoLoc names...

So

GeoLoc1/Unit Name1
GeoLoc2/Unit Name2
GeoLoc1/Unit Name3
GeoLoc1/Unit Name4
GeoLoc2/Unit Name5
GeoLoc2/Unit Name6

would be

Unit Name1 | UK
Unit Name2 | USA
Unit Name3 | UK
Unit Name4 | UK
Unit Name5 | USA
Unit Name6 | USA

Hope that makes sense...

Bob Phillips
10-26-2006, 05:23 AM
You need to createa a lookup table with the Geo name and country, like so

GeoLoc1/UK
GeoLoc2/USA
GeoLoc3/UK
GeoLoc4/UK
GeoLoc5/USA
GeoLoc6/USA

Then add another list of unit names, and use a formula of

=VLOOKUP(unit_name_cell,GeoCountryTable,2,False)

in the adjacent cell