# Thread: Associating a value with a cell Thanks: 0 Likes: 0

1. ## Associating a value with a cell

Sup everyone, I know the basics of Excel but I have an issue that is beyond my knowledge. I need to have a value populate a cell and change depending on what value I select in the first cell.

Here is a picture to clarify

In the "bin size" column I am going to have A, B, C, and D. Each one of these letters I need to have a corresponding value that shows up in the "bin width" column. For example when I select or put in A I need 4.13 to show up in the width column. When I put B in I need 6 to show up in the other column. When I put in C I need 11 to show up in the associated column.

What is the easiest way to do this because I have to mix and match these letters for almost 1000 cells and I don't want to have to go type in the bin width every time. Thanks!

2. ## Re: Associating a value with a cell

=VLOOKUP(X2,B:D,3,0)

where X2 is equal to a value like A; column B houses bin sizes, and column D bin widths.

Is this what you are after?

3. ## Re: Associating a value with a cell

=VLOOKUP(X2,B:D,3,0)

where X2 is equal to a value like A; column B houses bin sizes, and column D bin widths.

Is this what you are after?
I think that is close but I am still not getting it formatted correctly. I can't explain it well so let's try this

The table circled in blue are the values I want to use. A-D are the bin size and the column beside it are the bin widths. The column circled in green is where I want to type A, B, C or D(bin size) and when I put in the letter I want the corresponding value (A-4.13, B-6, C-11, D-22) to populate in the same row where the red circle is.

For example in cell F10 when I type C I want the value of 11 to show up in H10. Then go back and erase C in cell F10 and type in A and the value of 4.13 to show up in H10. Thanks for the help, Youtube videos were a bust lol.

4. ## Re: Associating a value with a cell

In H10 enter:

=VLOOKUP(F10,\$F\$4:\$G\$7,2,0)

5. ## Re: Associating a value with a cell

In H10 enter:

=VLOOKUP(F10,\$F\$4:\$G\$7,2,0)
That did it, awesome thanks!!!! I don't know enough about excel but what made it work in that formula compared to your first? Is it the \$ or what? I am not sure how to understand that formula for Vlookup.

6. ## Re: Associating a value with a cell

Originally Posted by rider_01
That did it, awesome thanks!!!! I don't know enough about excel but what made it work in that formula compared to your first? Is it the \$ or what? I am not sure how to understand that formula for Vlookup.
You are welcome. The first one was generic; the second specific, that is, the generic one adapted to your specific layout.

VLOOKUP(X2,B:D,3,0) --> VLOOKUP(F10,\$F\$4:\$G\$7,2,0)

That is:

X2 --> F10

\$B:\$D ---> \$F\$4:\$G\$7

3 --> 2, i.e. the result to be had is in the 2d column.

0 --> 0, i.e. exact match required.