I am trying to look up a value and return the value in the next column, however if the lookup value does not appear, then lookup the value in a seperate column. I have excel 2003.
I am trying to look up a value and return the value in the next column, however if the lookup value does not appear, then lookup the value in a seperate column. I have excel 2003.
Probably need more info on your data setup. In any case, it will be something like this.....
= IF(ISNUMBER(MATCH(A1, Data!$A$1:$A$50,0)),VLOOKUP(A1, Data!$A$1:$B$50,2,FALSE),VLOOKUP(A1, Data!$A$52:$B$102,2,FALSE))
Does that work for you?
ChemistB
My 2?
substitute commas with semi-colons if your region settings requires
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Hi Wildcat,
It's a little tricky to explain without sample data, but if you could use something like the following if your lookup value was in A1 (I'm searching for "a" in this example), and your data is in B1 and C1 (2 and 3, respectively).
If you wanted to return the second column when A1 is "a", but return the third column when A1 is not "a", you could use the following:
=IF(A1="a",VLOOKUP("a",A1:C1,2,FALSE),IF(A1<>"a",VLOOKUP(A1,A1:C1,3,FALSE)))
Hope that helps,
David
Thanks chemistB that worked great for me. If I wanted to search additional columns beyond the two, would I just add the additional vlookups to look at the additional columns, or would I have to add any other logic.
Thanks again.
Maybe replacing thepart with![]()
Please Login or Register to view this content.
would make the calculation faster ? ( if needed)![]()
Please Login or Register to view this content.
You could add additional IF statements (nesting). Excel 2003 has a limit of 7. Depending on your data set up, there may be simplier ways.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks