Forum Discussion
jensor4
Feb 04, 2023Copper Contributor
Nested if function
I have 3 inputs that may be entered in A3 (Fruit, meat, or veg) and 2 inputs (buy or sell) that may be entered in cell B3. I generated a reference table of pricing for the 6 different combinations of...
- Feb 04, 2023
I'd use a two-dimensional lookup table:
The formula in C3 is
=INDEX($F$2:$G$4,MATCH(A3,$E$2:$E$4,0),MATCH(B3,$F$1:$G$1,0))
Patrick2788
Feb 04, 2023Silver Contributor
With the way you've arranged your worksheet there's no need for a nested IF. You may use an XLOOKUP:
This formula presumes you have carriage returns (alt+enter) in your pricing header. CHAR(10) accounts for this carriage return.
=XLOOKUP(buysell&CHAR(10)&item,category,prices)