Forum Discussion
katie
Jul 07, 2017Brass Contributor
Multiple IF function
I am trying to apply appropriate commissions based on finding "CR" in a column. So far, I have: =SUM((ISNUMBER(SEARCH("CR",D3))*(I3*0.65))) - which if it finds CR in field D3, it multiples field ...
- Jul 07, 2017
Another less straight forward solution:
=(1-MMULT({0.35,1},COUNTIF(D3,{"*CR*";"*INV*"})))*I3
Detlef_Lewin
Jul 07, 2017Silver Contributor
Another less straight forward solution:
=(1-MMULT({0.35,1},COUNTIF(D3,{"*CR*";"*INV*"})))*I3katie
Jul 07, 2017Brass Contributor
You're a genius! Thank you so much!! Truly, thank you!!
- Detlef_LewinJul 07, 2017Silver Contributor
Or with a lookup table:
=LOOKUP(2,1/COUNTIF(D3,"*"&{"";"CR";"INV"}&"*"),{1;0.65;0})*I3- SergeiBaklanJul 07, 2017Diamond Contributor
Detlef, great!
Just for the collection the equivalent of MMULT
=(1-SUMPRODUCT(COUNTIF(D3,{"*CR*","*INV*"})*{0.35,1}))*I3- Detlef_LewinJul 07, 2017Silver Contributor
SUMPRODUCT() was my first attempt, Sergej.
But I like MMULT() more than SUMPRODUCT().
:-)