Nested IF(ISNA(Vlookup or ?

stapuff

Well-known Member
Joined
Feb 19, 2004
Messages
1,126
I read a post that doing multiple Vlookup's is not a very efficient way to find a value in multiple places.


B2 is where I want the result of up to 3 different ranges

This is not written correctly. I just wanted to illustrate the ranges.
Vlookup,A2,F2:G200,2,False
Vlookup,A2,M2:O250,2,False
Vlookup,A2,X2:Z150,3,False

I have been able to get a double lookup to work but not a third.

What is a better way to do multiple range lookups or how could I add the 3 Vlookup.

At home right now so I can't post the IF(ISNA(VLOOKUP statement that I already have.

Thanks,


Kurt
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi Kurt:

It will be nice if you can post a few rows of your sample data showing your data layout and expected results -- so we can clearly see what you are working with -- and then le tus take it from there.
 
Upvote 0
Yogi -

I am not allowed to use Colo at work and I did not think of sending the Wb home.

The just of it is a follows:

A2:A150 is a list of our customer part #'s(open orders). B2:B150 will be a list of our part #'s that are tied to our customer's. Parent/Child type of relationship.

Each of the 3 vlookup ranges are different commodities.

Range 1 is fully machined aluminum castings
Range 2 is cast (Only) aluminum castings
Range 3 is components that are assembled onto the castings

Each one of the ranges is downloaded from our AS-400 system.

I thought I had the thing licked until range 3 came into play.

A2 will be 1 of the 3 ranges and only 1.

Thanks,

Kurt
 
Upvote 0
Hi Kurt:

Let us see if I have captured your intent correctly ...
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1#N/A#N/A5
2X_4Y_4MachinedAL1MachinedAL2CastAL1CastAL2CastAL3Assemb1Assemb2Assemb3
3F_2G_2M_2N_2O_2X_2Y_2Z_2
4F_3G_3M_3N_3O_3X_3Y_3Z_3
5F_4G_4M_4N_4O_4X_4Y_4Z_4
6M_5N_5O_5X_5Y_5Z_5
7M_6N_6O_6
8
Sheet11


A2 houses the entry to be Looked up in the Table F2:Z7

array formula in cell F1 is ... =MATCH(TRUE,$A2=F3:F7,0)+ROW($2:$2)

this is then copied to cells M1 and X1

then finally the formula in cell B2 is ... =INDEX(A1:Z7,INDEX(1:1,MATCH(26,1:1)),MATCH(26,1:1)+1)

Would this do?
 
Upvote 0
stapuff said:
I read a post that doing multiple Vlookup's is not a very efficient way to find a value in multiple places.


B2 is where I want the result of up to 3 different ranges

This is not written correctly. I just wanted to illustrate the ranges.
Vlookup,A2,F2:G200,2,False
Vlookup,A2,M2:O250,2,False
Vlookup,A2,X2:Z150,3,False

I have been able to get a double lookup to work but not a third.

What is a better way to do multiple range lookups or how could I add the 3 Vlookup.

At home right now so I can't post the IF(ISNA(VLOOKUP statement that I already have.

Thanks,


Kurt

Multi-cell approach...

D2:

=VLOOKUP(A2,$F$2:$G$200,2,0)

C2:

=IF(ISNA(D2),VLOOKUP(A2,$M$2:$O$250,2,0),D2)

B2, which is the final result cell:

=IF(ISNA(C2),VLOOKUP(A2,$X$2:$Z$150,3,0),C2)

If the lookup tables are sorted in ascending order on their first columns, a more efficient set up is also possible.
 
Upvote 0
Yogi -

I am still trying to digest your post.

1 question though:

What if X4 is in more than 1 range?


Could a nested IF(Findoffset be a possibility?

Thanks,

Kurt
 
Upvote 0
stapuff said:
Yogi -

I am still trying to digest your post.

1 question though:

What if X4 is in more than 1 range?
<font color="blue">My formula will pick up from the first occurance of X_4 going left to right. I don't know your project requirements or constraints, however I believe you will not have have ovelapping designations for different material specs or assemblies</font>
Could a nested IF(Findoffset be a possibility?
<font color="blue">Sorry, without knowing what your setup with identical or overlapping designations might look like, I can't say. If you do have a formula in mind , how about if you post your formula with the corresponding data -- and then let us take it from there.</font>
 
Upvote 0
Yogi -


Nest IF - Something like this:

=IF(FindOffset(Product_Structures!X2:X200,A17,1)=0,FindOffset(Product_Structures!AE2:AE200,A17,1),(IF(FindOffset(Product_Structures!AE2:AE200,A17,1)=0,(FindOffset(Product_Structures!J2:J200,A17,1),(IF(FindOffset(Product_Structures!J2:J200,A17,1)=0,0,FindOffset(Product_Structures!X2:X200,A17,1)))))))

This is the last of many variations. I tried =0, =false, etc. I keep getting N/A

Thanks,

Kurt
 
Upvote 0
In addition a quick update. I have gotten this down to 2 cells required.

In B4 I have:
=IF(ISNA(VLOOKUP(A4,Product_Structures!$X$2:$AB$1000,2,FALSE)),VLOOKUP(A4,Product_Structures!$AE$2:$AI$1000,2,FALSE),VLOOKUP(A4,Product_Structures!$X$2:$AB$1000,2,FALSE))

In C4 I have:
=IF(ISNA(B4),VLOOKUP(A4,Product_Structures!$J$2:$N$200,2,FALSE),(B4))

Thank You Aladin for the suggestion.

My intent is getting it down to only 1 cell being needed however I can live with the extra cells if required.

Thanks,

Kurt
 
Upvote 0
stapuff said:
In addition a quick update. I have gotten this down to 2 cells required.

In B4 I have:
=IF(ISNA(VLOOKUP(A4,Product_Structures!$X$2:$AB$1000,2,FALSE)),VLOOKUP(A4,Product_Structures!$AE$2:$AI$1000,2,FALSE),VLOOKUP(A4,Product_Structures!$X$2:$AB$1000,2,FALSE))

In C4 I have:
=IF(ISNA(B4),VLOOKUP(A4,Product_Structures!$J$2:$N$200,2,FALSE),(B4))

Thank You Aladin for the suggestion.

My intent is getting it down to only 1 cell being needed however I can live with the extra cells if required.

Thanks,

Kurt
Hi Kurt:

Here is a one cell solution ...
y041110h1.xls
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2X_4Y_4MachinedAL1MachinedAL2CastAL1CastAL2CastAL3Assemb1Assemb2Assemb3
3F_2G_2M_2N_2O_2X_2Y_2Z_2
4F_3G_3M_3N_3O_3X_3Y_3Z_3
5F_4G_4M_4N_4O_4X_4Y_4Z_4
6M_5N_5O_5X_5Y_5Z_5
7M_6N_6O_6
8
Sheet11 (2)


formula in cell B2 is ...

=IF(ISNA(VLOOKUP(A2,F2:G7,2,0)),IF(ISNA(VLOOKUP(A2,M2:O7,2,0)),IF(ISNA(VLOOKUP(A2,X2:Z7,2,0)),NA(),VLOOKUP(A2,X2:Z7,2,0)),VLOOKUP(A2,M2:O7,2,0)),VLOOKUP(A2,F2:G7,2,0))

As you can see it does get quite unnwieldy -- and if you have to incorporate more choices, it becomes even more cumbersome.
 
Upvote 0

Forum statistics

Threads
1,222,804
Messages
6,168,325
Members
452,179
Latest member
ali riza60

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top