IF AND nesting and how to avoid the 64 nest limit

garthey

New Member
Joined
Apr 29, 2019
Messages
2
Good morning,

I hope someone will be able to assist me, I am creating a worksheet that looks for a value ( For example Servon ) and second value ( For example EE Estonia ), based on this it would pull data from the relevant worksheet Servon EX EE.

I currently have the formula laid as below but I have exceeded the 64 nest limit and sadly i am not able to think of another way of storing the data, other than have all in 1 Export sheet although this would be massive and not easy to edit with updates.

Below I have put my formula:

=IF(AND(Reference!$AD$12="Servon",Calc!$I$3="EE"),'EE EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="EE"),'EE EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="EE"),'EE EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="LV"),'LV EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="LV"),'LV EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="LV"),'LV EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="LT"),'LT EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="LT"),'LT EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="LT"),'LT EX Lyon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="NO"),'NO EX Dijon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="NO"),'NO EX Servon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="NO"),'NO EX Lyon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="SE"),'SE EX Lyon'!A2, IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="SE"),'SE EX Dijon'!A2, IF(AND(Reference!$AD$12="Servon",Calc!$I$3="SE"),'SE EX Servon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="FI"),'FI EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="FI"),'FI EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="FI"),'FI EX Dijon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="DK"),'DK EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="DK"),'DK EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="DK"),'DK EX Servon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="RO"),'RO EX Servon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="RO"),'RO EX Lyon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="RO"),'RO EX Dijon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="HU"),'HU EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="HU"),'HU EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="HU"),'HU EX Servon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="CZ"),'CZ EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="CZ"),'CZ EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="CZ"),'CZ EX Dijon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="BE"),'BE EX Dijon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="BE"),'BE EX Servon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="BE"),'BE EX Lyon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="AT"),'AT EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="AT"),'AT EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="AT"),'AT EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="BG"),'BG EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="BG"),'BG EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="BG"),'BG EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="GR"),'GR EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="GR"),'GR EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="GR"),'GR EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="PL"),'PL EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="PL"),'PL EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="PL"),'PL EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="SI"),'SI EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="SI"),'SI EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="SI"),'SI EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="GB"),'GB EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="GB"),'GB EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="GB"),'GB EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="LU"),'LU EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="LU"),'LU EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="LU"),'LU EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="TR"),'TR EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="TR"),'TR EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="TR"),'TR EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="CH"),'CH EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="CH"),'CH EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="CH"),'CH EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="HR"),'HR EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="HR"),'HR EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="HR"),'HR EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="ES"),'ES EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="ES"),'ES EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="ES"),'ES EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="PT"),'PT EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="PT"),'PT EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="PT"),'PT EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="DE"),'DE EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="DE"),'DE EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="DE"),'DE EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="IT"),'IT EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="IT"),'IT EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="IT"),'IT EX Servon'!A2,IF(AND(Reference!$AD$12="Dijon",Calc!$I$3="NL"),'NL EX Dijon'!A2,IF(AND(Reference!$AD$12="Lyon",Calc!$I$3="NL"),'NL EX Lyon'!A2,IF(AND(Reference!$AD$12="Servon",Calc!$I$3="NL"),'NL EX Servon'!A2)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

Would be extremely grateful for someones help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi & welcome to MrExcel.
Have a look at the INDIRECT function
like
=INDIRECT("'"&Calc!$I$3&" EX "&Reference!$AD$12&"'!A2")
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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