![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 38
|
I was wondering if you can do something like this with vlookups:
If the value in A1 is in the first lookup range, return the value in D1. If not in that range, then look A1 in the second range, and return the value in D1 of the second range. Else, return N/A. Is this possible?? |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Quote:
if the value in A1 exists in your first lookup, do you want it to bring back the value IN CELL D1 or the respective value in the VLOOKUP range no matter where it is ? ditto the second arguement.... |
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 38
|
I want to look up the value in column A of my worksheet in a lookup table. If a match is found, I want to return the corresponding value from that lookup range. If the value is not found in the first lookup range, then I want to look the value up in a second lookup table, and the corresponding value returned if a match is found. I want the N/A error if the value can't be found in either of the 2 lookup tables.
|
|
|
|
|
|
#4 | |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,030
|
G'day,
Quote:
=IF(COUNTIF(Range1,A2)>0,Vlookup(A2,Range1,2,0),IF(COUNTIF(Range2,A2)>0,VLOOKUP(A2,Range2,2,0),"")) Hope that helps, Adam |
|
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,318
|
Quote:
http://www.mrexcel.com/board/viewtop...c=7944&forum=2 which might be adapted to your situation. [ This Message was edited by: Aladin Akyurek on 2002-05-13 13:36 ] |
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Mar 2002
Posts: 38
|
Solution found.
Thanks Aladin for the thread; it was very helpful. Using IF(ISNA(VLOOKUP1),VLOOKUP2,VLOOKUP1) works just fine for my problem. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|