Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill a cell based on equal value

Status
Not open for further replies.

bigmerf

MIS
Oct 4, 2002
247
US
I would like to write a formula in Excel that will check the value of a cell and compare that against another range of cells and if Excel finds an exact match within that range, it will display the value of the cell next to it.

For instance:
A1 = ABC
A2 = ZZZ
A3 = VRE
A4 = ZZZ

D1 = ZZZ E1 = 1
D2 = ABC E2 = 2
D3 = VRE E3 = 3

I want to write a formula that first checks cell A1 against the range of cells (D1:D3) and if a match is found, use the value from that corresponding cell (E1:E3) to be fed into the original cell (A2).

Can this be done using a formula. I can do this in Access not problem, unfortunately I have to use Excel for this particular task.

The final result would be
B1 = 2
B2 = 1
B3 = 3
B4 = 1

Any help would be great!
 
Hi there,

You can get what you want using the VLOOKUP function..

eg. in cell B1.

Code:
=VLOOKUP(A1,D$1:E$3,2,FALSE)

Remember- It's nice to be important,
but it's important to be nice :)
 
Excellent. That worked great! Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top