Link to home
Start Free TrialLog in
Avatar of Ted Penner
Ted PennerFlag for United States of America

asked on

Using the lookup formula

I may even have the wrong formula but I need to accomplish the following goal which I think I have stated correctly based on the attached screenshot.

The original phone extension number (X1445) is noted in cell Y15 along with the correspnding cube number (cube 13) in cell Z15 .

If I enter enter X1445 into cell U3, then I want the adjacent cell V3 to populate with data from Z15.


Assistance is greatly appreciated.
temp.PNG
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

In cell V3, enter this formula...

    =VLOOKUP(U3, Y:Z, 2, FALSE)
Avatar of Ted Penner

ASKER

Thank you, can you explain the syntax?
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Excellent, it does work but produces an error in the V column if there is no value yet in the adjacent U column.  It would be best if it did not show #N/A or produce an error, or a number until an extension number is actually entered in the U column.
You can eliminate errors in one of 2 ways....

1. Using a Condition


=IF(U3="", "", VLOOKUP(U3, Y:Z, 2, FALSE))

This checks if cell U3 contains a value. If it doesn't, it returns an empty string. If it does, it returns the results of the VLOOKUP function. Note that this will still return an error if the value in cell U3 is not found.

2. Checking for Error


=IFERROR(VLOOKUP(U3, Y:Z, 2, FALSE), "")

This will return an empty string if the value of the VLOOKUP function is an error.

3. Combination


=IF(U3="", "", IFERROR(VLOOKUP(U3, Y:Z, 2, FALSE), ""))

This will return an empty string if the cell U3 is empty or the value cannot be found.