简体   繁体   中英

Populate data in cell based on another cells data

I'm trying to look at one cell and populate another cell based on the other value. Keeping in mind, there are 100's of items. Example:

a1: Texas

b1: City is El Paso

a2: Texas Oklahoma

b2: City is El Paso City is Enid

So, one cell in A1 could have 1 to 10 different states. B1 would need to fill in based on all the values of A1.

I'm assuming I would need a master table containing all the values and then based on what was in A, populate B, but I am not sure how to get there.

Screenshot example: Screenshot example:] sample

It sounds like you have 10 states and 10 cities, you have the list of states but you need to match the corresponding cities to each of the known states.

If this is the case, use the vlookup function like this.

  1. Put a small table to the side with all the state and cities side by side with the cities to the right.
  2. Use the vlookup formula VLOOKUP(A2, J:K, 2,FALSE)
    • Explaining this formula section by section
    • A2 in this case will be cell the formula uses to search your table
    • J:K is the columns your Table is in.
    • 2 tells the formula to give back the second column (counting left to right)
    • FALSE, means only give things that exactly match what you are looking for.

查找

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM