Forum Discussion
Prevenda_XPTA
Sep 02, 2021Copper Contributor
Multiple parameters for formula IF (with different cells)
Hello, I'm trying to compose a formula using "IF", considering the complexity of using parameters informed in two columns to defining the result in a third column(if true) based on the selectio...
- Sep 02, 2021
=IF(AND(A2="Company 01",B2="Project"),120,IF(AND(A2="Company 01",B2="Presales"),90,IF(AND(A2="Company 02",B2="Project"),150,IF(AND(A2="Company 02",B2="Presales"),115))))
=IF( AND( A2 = "Company 01" ), { B2 = "Project" ) ), { 120 ), { IF( AND( A2 = "Company 01" ), { B2 = "Presales" ) ), { 90 ), { IF( AND( A2 = "Company 02" ), { B2 = "Project" ) ), { 150 ), { IF( AND( A2 = "Company 02" ), { B2 = "Presales" ) ), { 115 ) ) ) )
PeterBartholomew1
Sep 03, 2021Silver Contributor
Some 365 variants with the data built into the formula.
= LET(
V,{120,90;150,115},
C, XMATCH(Company,{"Company 1";"Company 2"}),
D, XMATCH(Description,{"Project";"Presales"}),
INDEX(V,C,D)
)with the values held as a 2x2 array.
The next step could be to hide all the 'nuts and bolts' within a Lambda function 'VALUEλ'
= LAMBDA(Co,Dn,
LET(
V,{120,90;150,115},
C, XMATCH(Co,{"Company 1";"Company 2"}),
D, XMATCH(Dn,{"Project";"Presales"}),
INDEX(V,C,D)
)
)so that the final worksheet formula reads
= VALUEλ(Company,Description)Like the first two of Riny_van_Eekelen's formulas, it can be applied to an entire list of companies and value descriptions as a single dynamic array.