Hi,
I need to take this formula:
=IF(OR(B2="20FL", B2="20OT", B2="20OH"), MAX(0, W2*30 + X2*45 + Y2*60), IF(OR(B2="40FC", B2="40FL", B2="40OH", B2="40OT", B2="40PL"), MAX(0, W2*50 + X2*70 + Y2*95), IF(OR(B2="40RF", B2="40RH"), MAX(0, Z2*110), IF(B2="20RF", MAX(0, W2*90+X2*100), IF(LEFT(B2,2)="20", MAX(0, W2*30 + X2*35 + Y2*40), IF(LEFT(B2,2)="40", MAX(0, W2*45 + X2*55 + Y2*65)))))))
but cells w2,x2,y2 will not exist in it, instead these should be the values:
w2 as:
x2 as:
y2 as :
You should not use helper columns. all formulas in one cell.
Can someone write a combined formula that works?
Thanks
Auxiliary formula: A way to see the three results at once in the format a, b, c:
I need to take this formula:
=IF(OR(B2="20FL", B2="20OT", B2="20OH"), MAX(0, W2*30 + X2*45 + Y2*60), IF(OR(B2="40FC", B2="40FL", B2="40OH", B2="40OT", B2="40PL"), MAX(0, W2*50 + X2*70 + Y2*95), IF(OR(B2="40RF", B2="40RH"), MAX(0, Z2*110), IF(B2="20RF", MAX(0, W2*90+X2*100), IF(LEFT(B2,2)="20", MAX(0, W2*30 + X2*35 + Y2*40), IF(LEFT(B2,2)="40", MAX(0, W2*45 + X2*55 + Y2*65)))))))
but cells w2,x2,y2 will not exist in it, instead these should be the values:
w2 as:
Excel Formula:
IF(B2="20rf",
MAX(
IF(L2<=M2,
0,
IF(M2<=3,
MIN(IF(L2-3<0, 0, L2-3), 8),
IF(AND(M2>3, M2<11),
MIN(11-M2, 8),
IF(M2>=11,
0,
MAX(0, L2-11)
)
)
)
),
0
),
MAX(
IF(AND(L2=11, M2=10),
1,
IF(L2<=M2,
0,
IF(M2<=7,
MIN(IF(L2-7<0, 0, L2-7), 5),
IF(AND(M2>7, M2<12),
MIN(12-M2, 5),
IF(M2>=12,
0,
MAX(
IF(L2<=M2,
0,
IF(M2<=7,
MIN(IF(L2-12<0, 0, L2-12), 7),
IF(AND(M2>7, M2<=12),
MIN(L2-12, 7),
IF(AND(M2>12, M2<=19),
MIN(L2-M2, 19-M2, 7),
IF(M2>19, 0)
)
)
)
),
0
)
)
)
)
)
),
0
)
)
Excel Formula:
MAX(
IF(B2="20rf",
IF(L2<=M2,
0,
IF(M2>=11,
L2-M2,
MAX(0, L2-11)
)
),
IF(AND(L2<=M2, M2<=7),
MIN(IF(L2-12<0, 0, L2-12), 7),
IF(AND(M2>7, M2<=12),
MIN(L2-12, 7),
IF(AND(M2>12, M2<=19),
MIN(L2-M2, 19-M2, 7),
IF(M2>19,
0,
MAX(L2-19, 0)
)
)
)
)
),
0
)
Excel Formula:
MAX(
IF(B2="20rf",
0,
IF(L2<=M2,
0,
IF(M2>=19,
L2-M2,
MAX(L2-19, 0)
)
)
),
0
You should not use helper columns. all formulas in one cell.
Can someone write a combined formula that works?
Thanks
Auxiliary formula: A way to see the three results at once in the format a, b, c:
Excel Formula:
=IF(B2="20rf",
MAX(
IF(L2<=M2,
0,
IF(M2<=3,
MIN(IF(L2-3<0, 0, L2-3), 8),
IF(AND(M2>3, M2<11),
MIN(11-M2, 8),
IF(M2>=11,
0,
MAX(0, L2-11)
)
)
)
),
0
),
MAX(
IF(AND(L2=11, M2=10),
1,
IF(L2<=M2,
0,
IF(M2<=7,
MIN(IF(L2-7<0, 0, L2-7), 5),
IF(AND(M2>7, M2<12),
MIN(12-M2, 5),
IF(M2>=12,
0,
MAX(
IF(L2<=M2,
0,
IF(M2<=7,
MIN(IF(L2-12<0, 0, L2-12), 7),
IF(AND(M2>7, M2<=12),
MIN(L2-12, 7),
IF(AND(M2>12, M2<=19),
MIN(L2-M2, 19-M2, 7),
IF(M2>19, 0)
)
)
)
),
0
)
)
)
)
)
),
0
)
)
& "," &
MAX(
IF(B2="20rf",
IF(L2<=M2,
0,
IF(M2>=11,
L2-M2,
MAX(0, L2-11)
)
),
IF(AND(L2<=M2, M2<=7),
MIN(IF(L2-12<0, 0, L2-12), 7),
IF(AND(M2>7, M2<=12),
MIN(L2-12, 7),
IF(AND(M2>12, M2<=19),
MIN(L2-M2, 19-M2, 7),
IF(M2>19,
0,
MAX(L2-19, 0)
)
)
)
)
),
0
)
& "," &
MAX(
IF(B2="20rf",
0,
IF(L2<=M2,
0,
IF(M2>=19,
L2-M2,
MAX(L2-19, 0)
)
)
),
0
)
Attachments
Last edited by a moderator: