How to auto-fill text based on text in another cell
Hello,
I need to know how to auto-fill text based on text in another cell. For example: Every time I enter "CHS" in Column B, I want Charleston to auto-fill in Column C. And when I enter "SAN", in Column B, I want San Diego to auto-fill in Column C. How can I set up a list like this? Any ideas? Thanks! Jason |
One way is to create a table of airport codes and cities,
then use VLOOKUP. See here for instructions: http://www.contextures.com/xlFunctions02.html HTH Jason Atlanta, GA -----Original Message----- Hello, I need to know how to auto-fill text based on text in another cell. For example: Every time I enter "CHS" in Column B, I want Charleston to auto-fill in Column C. And when I enter "SAN", in Column B, I want San Diego to auto-fill in Column C. How can I set up a list like this? Any ideas? Thanks! Jason . |
Jason
Probably VLOOKUP could work for you. Assume your table of abbreviations and cities are in M1:N10 In C1 enter =VLOOKUP(B1,$M$1:$N$10,2,0) Enter CHS in B1 to return Chareston in C1. You could also turn B1 into a drop-down list so's you could just pick the abbreviation, not type it. Select B1 then DataValidationList. Select M1:M10 as your list. Gord Dibben Excel MVP On Wed, 16 Feb 2005 10:59:04 -0800, "Jason" wrote: Hello, I need to know how to auto-fill text based on text in another cell. For example: Every time I enter "CHS" in Column B, I want Charleston to auto-fill in Column C. And when I enter "SAN", in Column B, I want San Diego to auto-fill in Column C. How can I set up a list like this? Any ideas? Thanks! Jason |
use a vlookup table Create your table on a new sheet (name the range "MyList") with Char | Charleston, San | San Diego, Det | Detroit, Chi | Chicago, Lon | London....etc. in adjacent columns and sort ascending. In your first cell in col C (Cn) enter =VLOOKUP(Bn,MyList,2) {change the 'n' to match the row you are in} Copy this formula down your desired range entering San in Bn will return San Diego in Cn Question: How will you handle San Jose, San Antonio, etc.? HTH -- swatsp0p ------------------------------------------------------------------------ swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101 View this thread: http://www.excelforum.com/showthread...hreadid=346038 |
All times are GMT +1. The time now is 07:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com