nesting more than 7 if functions-possible?

ngc2392

Board Regular
Joined
Oct 24, 2002
Messages
54
hello guys...

need help with if functions. is there a way around about restriction of 7 if functions in one function? i have 9 if situations and now i run out of options :) is there maybe a vba solution? problem is quite easy...if a=1 vlookup that range, if=2 vlookup another range (to simplify). and that up to 7 times. thanks in advance...
 
Aw shoooooot :)

I read the **** pattern wrong. Hate missing numbers in patterns. I might be going blind here, but does this do it then - expandable if the lookup tables are all set a column apart as in the example

=VLOOKUP(J11,(OFFSET(OPIS!A1,,(MATCH(H11,{"B","C","D","F","G","H"},0)-1)*3,60,2)),2,0)
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Here I added 2 more:

=VLOOKUP(J11,CHOOSE(MATCH(H11,{"B","C","D","F","G","M","N","O","P"},0),OPIS!$A$10:$B$60,OPIS!$D$10:$E$60,OPIS!$G$10:$H$60,OPIS!$J$10:$K$60,OPIS!$M$10:$N$60,OPIS!$P$10:$Q$60,OPIS!$S$10:$T$60,OPIS!$V$10:$W$60,OPIS!$Y$10:$Z$60),2)

With semicolon:

VLOOKUP(J11;CHOOSE(MATCH(H11;{"B";"C";"D";"F";"G";"M";"N";"O";"P"};0);OPIS!$A$10:$B$60;OPIS!$D$10:$E$60;OPIS!$G$10:$H$60;OPIS!$J$10:$K$60;OPIS!$M$10:$N$60;OPIS!$P$10:$Q$60;OPIS!$S$10:$T$60;OPIS!$V$10:$W$60;OPIS!$Y$10:$Z$60);2)
 
Upvote 0
LOL

OFFSET allows you to specify a starting cell and then create a range by specifying how may rows/columns away from it to start. eg =OFFSET(A1,4,7) means start at A1 and then go down 4 rows and across 7 columns, so you end up at cell H5.

I can then add the last 2 arguments that allow me to specify how high and wide the range is to be from that point, eg

=OFFSET(A1,4,7,60,2)

takes the starting point of A1, uses the first two arguments to get to H5, and then from there expands to a height of 60 rows (including H5) and 2 columns wide (including H5), so your range you just created is H5:I64

So the trick with your data is to find the pattern fo rthe table references and then use other functions to build the numbers to go in the arguments for the OFFSET function.

Your tables are all set 3 cols apart, eg

AB (offset from A1 is 0 rows)
DE (offset from A1 is 3 rows)
GH (offset from A1 is 6 rows) etc

Just need then to get a pattern that increments in 3s. Given that your lookup values don't seem to follow an exact pattern, it seems easiest to use MATCH to return a 1,2,3,4,5 etc depending on which value it matches H11 to, take 1 away from it so that you get the values 0,1,2,3,4,5 etc instead (You need to get a 0 for the first result so you can hit A1), and then just multiply by 3 to get the feed for the OFFSET argument.

Addendum

Thanks fairwinds, much appreciated :)
 
Upvote 0
oh yes...ken...yours also working. after i put some minor corrections :) well...u teach me smth new here :) thanks again both of you
 
Upvote 0
thanks ken for that explanation. still...i'm not so gooood in excel whatsoever :) anyway...i owe you two one (or two)...:)
 
Upvote 0

Forum statistics

Threads
1,216,051
Messages
6,128,503
Members
449,455
Latest member
jesski

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