Solved

Excel formula help - vlookup maybe?

Posted on 2011-02-28
2
280 Views
Last Modified: 2012-05-11
not sure if vlookup is what i want here, but here's what i need:

A    B    C    D
5
6          1
7                 2
8     3
9                 4

i need a formula that will look at a value (X) and compare to table above.  If X is in column A, set = X.  If X is in column B, C, or D, set = to the corresponding value in column A.  So, if X=2, set = 7 or if X=5, set = 5.
0
Comment
Question by:darrennelson
2 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 125 total points
ID: 35001938
Hello darren,

If your table is in A1:D5 and the "lookup value" is in A8 then you can use this "array formula"

=INDEX(A$1:A$5,SMALL(IF(A$1:D$5=A8,ROW(A$1:D$5)-ROW(A$1)+1),1))

confirmed with CTRL+SHIFT+ENTER

If you want to avoid error values if the lookup value isn't in the table then switch to a version like this

=IF(COUNTIF(A$1:D$5,A8),INDEX(A$1:A$5,SMALL(IF(A$1:D$5=A8,ROW(A$1:D$5)-ROW(A$1)+1),1)),"No Match")

That will return "No match" if lookup value doesn't exist

see attached

regards, barry
26853833.xls
0
 

Author Closing Comment

by:darrennelson
ID: 35002683
exactly what i was looking for, thanks
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question