Currently the formula in cell B3 works by only looking up the value in B2 in the "Total Debt/Capital" table of cells D1:K6. How do I make the formula in B3 dynamic so it will change which table it looks at based in the value in A2 ? So if A2 says "Net Debt / EBITDA" then it will use the table in V1:AC6 to return the value. The correct value returned should be "B".
Current Formula:
=XLOOKUP(B2,XLOOKUP(B1,D2:D6,E2:K6),E1:K1,,1,-1)

Try using the following formula:
Capital--> Range fromD1:K6,EBITDAforM1:T6and lastly,NEBITDAforV1:AC6LET()function to define variables.IFS()orSWITCH()you can return the_LookupTableand use as a reference array for theXLOOKUP()functions.Or, making it more clearer, with each steps:
Note: It can be made more shorter by using
Volatilefunctions likeINDIRECT()but avoided using it since its volatile in nature, will slow down the working functionality ofExcelas well as it will keep recalculating whenever there is a change in any open workbook.