Hi all,
I am facing a problem with Excel formula.
I have an Excel WorkBook which play with steel beams.
I have a set named ranges, all with same structure: ref_ipe, ref_ipea, ref_hea, ref_heb, ref_upn, ref_upe ...
All nice so far.
I have this kind of formula where I need to switch named ranges depending on user inputs:
=VLOOKUP(B287,IF(A287="IPE",ref_ipe,IF(A287="HEA",ref_hea,IF(A287="UPN",ref_upn,IF(A287="TUBE",ref_tubec,ref_l)))),2,FALSE))
This formula works and is fast, but my problem is that I am asked to add more named ranges, and it is where it become a pain to add more and more nested IFs.
As an alternative I have done this:
=VLOOKUP(B23,INDIRECT(VLOOKUP(A23,{"IPE","ref_ipe";"IPEA","ref_ipea";"HEA","ref_hea"},2,FALSE)),2,FALSE)
which is neat to extend with more ranges, but since INDIRECT is volatile, my sheet is downgrade quickly as I have thousands of formulas to change.
What I have tried:
I have tried
=VLOOKUP(B23,VLOOKUP(A23,{"IPE",ref_ipe;"IPEA",ref_ipea;"HEA",ref_hea},2,FALSE),2,FALSE)
but excel don't want it, because
VLOOKUP can't return a range constant musts with named ranges are not allowed.
Do you know a better solution ?
Nota: formulas may contain errors as they are translated from French Excel.