Jeffrey Mahoney
Well-known Member
- Joined
- May 31, 2015
- Messages
- 3,142
- Office Version
- 365
- Platform
- Windows
I have two structured Excel Tables and a Cell called PRChoice that redirects my formulas to pull the right data. PR_A_Tbl and PR_B_Tbl. They have identical headers with different data sets. I want to simplify my formulas so I don't have to repeat the functions as:
=IFERROR(IFS(PRChoice="PR_A",XLOOKUP([@ID],PR_A_Tbl[ID],PR_A_Tbl[2023 LE],"",0),PRChoice="PR_B",XLOOKUP([@ID],PR_B_Tbl[ID],PR_B_Tbl[2023 LE],"",0),TRUE,"")*1000,0)
I created a Named range called PR_X_Tbl where I thought I could choose the right Table with the formula: =LET(PRTBL,IF(PRChoice="PR_B",PR_B_Tbl[#All],PR_A_Tbl[#All]),PRTBL)
That didn't work when I reference it like a structured table.
Is there another way to dynamically reference a Structured Table?
=IFERROR(IFS(PRChoice="PR_A",XLOOKUP([@ID],PR_A_Tbl[ID],PR_A_Tbl[2023 LE],"",0),PRChoice="PR_B",XLOOKUP([@ID],PR_B_Tbl[ID],PR_B_Tbl[2023 LE],"",0),TRUE,"")*1000,0)
I created a Named range called PR_X_Tbl where I thought I could choose the right Table with the formula: =LET(PRTBL,IF(PRChoice="PR_B",PR_B_Tbl[#All],PR_A_Tbl[#All]),PRTBL)
That didn't work when I reference it like a structured table.
Is there another way to dynamically reference a Structured Table?