Retrieve content of different cells based on input

3

I have a cell X where the user can enter a number. I then need to take that number N and get the value of another cell Y based on that.

The scenario is this:

The user can enter a product number and then I want a text description to be filled out next to the product number. So I need the value mapped to a field next to the product list, on the same sheet.

How can I achieve this?

TheRestaurantOwner

Posted 2012-05-23T14:05:29.637

Reputation: 33

It seems you wanted a solution for Microsoft Excel (which is not the sole spreadsheet application), so I added that tag. If this was incorrect of me I apologize, and I'll remove it if notified (or leave it free to anyone else to remove it). – Daniel Andersson – 2012-05-24T10:01:45.600

Actually Open Office in this case. – TheRestaurantOwner – 2012-05-25T17:19:54.603

Ok, re-tagging. – Daniel Andersson – 2012-05-25T19:02:14.780

Answers

3

I think what your looking for is the vlookup function. I've created a mockup of the scenario you spoke of in your question, I have a simple table in sheet 2:

ID      Description
1       This is part 1
2       This is part 2
3       This is part 3
4       This is part 4
5       This is part 5

So on sheet 1, we can use the vlookup function to gather data from this table:

Enter Lookup Value ::       3               


Description::   This is part 3  

We enter the lookup value as shown above, in your case this would be N. In the cell where your description will be shown, you enter the vlookup formula. Locate the cell, click on the 'Insert Function' button and select vlookup. The formula you end up with looks something like this:

=VLOOKUP(Sheet1!C1,Sheet2!A2:C6,2,FALSE)

Where (Sheet1!c1) is the location of the lookup value, Sheet2!A2:C6 is the data range, 2 is your description column and false is the range lookup but this can be left blank most of the time.

If you take a look at this very good article it explains everything in more detail:

http://www.howtogeek.com/howto/13780/using-vlookup-in-excel/

Hope this helps!

Dean

Posted 2012-05-23T14:05:29.637

Reputation: 674