Niall Walker
Niall Walker

Reputation: 195

Referring to another sheet's cell depending on the value of another

Not quite sure how to word it, but I'm currently doing a project on excel. So far I have the invoice sheet containing the customer number and pricing etc etc, and another to contain all customer information such as their home and email address and phone numbers in order of their customer number.

I am currently trying to have a formula automatically add the name of the customer depending on the number entered in the invoice. By this, I mean that when I enter a number in the column, it will refer to the customer spread sheet and retrieve the name. But I'm not sure how I will do this.

The only thing that comes to my head, is that logically it would be something like '=Customers!B(D3)', where D3 is the customer number. I would have thought that it would get the value of D3, and say D3 contains the number 3 then it will go to cell B3 in sheet Customers.

I'm not sure how to do this, so is there some sort of GetValue function? I mainly code Java so am fairly new to Excel. Any help would be greatly appreciated, Thanks :)

Upvotes: 1

Views: 266

Answers (1)

Sam
Sam

Reputation: 7313

There is a few different functions you could use for this but the best would be INDEX

To get the value in Column B use =Index(Customers!B1:H100,D3,1)

Column C =Index(Customers!B1:H100,D3,2)

The first argument is the range, second argument is row position, and third position is column position.

Here is some documentation to read

Upvotes: 1

Related Questions