Jul 07 2017
09:36 AM
- last edited on
Jul 25 2018
09:47 AM
by
TechCommunityAP
Jul 07 2017
09:36 AM
- last edited on
Jul 25 2018
09:47 AM
by
TechCommunityAP
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 I3 by .65.
I need it to then determine that if CR is not found, to multiply field I3 by 1.
Is that possible?
Jul 07 2017 09:58 AM
Hi Katie,
Perhaps something like
=I3*IF(ISNUMBER(SEARCH("CR",D3)),0.65,1)
Jul 07 2017 09:58 AM
Hi
Straight forward:
=IF(COUNTIF(D3,"*CR*"),0.65,1)*I3
Less straight forward:
=(1-COUNTIF(D3,"*CR*")*0.35)*I3
Jul 07 2017 10:03 AM
Jul 07 2017 10:03 AM
Jul 07 2017 10:07 AM
Jul 07 2017 10:16 AM
SolutionAnother less straight forward solution:
=(1-MMULT({0.35,1},COUNTIF(D3,{"*CR*";"*INV*"})))*I3
Jul 07 2017 10:19 AM
Jul 07 2017 10:22 AM
Or with a lookup table:
=LOOKUP(2,1/COUNTIF(D3,"*"&{"";"CR";"INV"}&"*"),{1;0.65;0})*I3
Jul 07 2017 10:47 AM
Detlef, great!
Just for the collection the equivalent of MMULT
=(1-SUMPRODUCT(COUNTIF(D3,{"*CR*","*INV*"})*{0.35,1}))*I3
Jul 07 2017 11:04 AM
SUMPRODUCT() was my first attempt, Sergej.
But I like MMULT() more than SUMPRODUCT().
:)
Jul 12 2017 10:06 AM
Jul 12 2017 10:22 AM
Katie, as variant that could be
=(1-MIN(MMULT({0.35,1},COUNTIF(E2,{"*CR*";"*INV*"})),1))*G2
Jul 12 2017 10:50 AM
It is sometimes frustrating for the helpers if you keep extendig the scope of the problem.
So, please always present the full scope of the problem in the first post.
=MAX(0,(1-MMULT({0.35,1},COUNTIF(E2,{"*CR*";"*INV*"}))))*G2
Jul 12 2017 10:51 AM
Jul 07 2017 10:16 AM
SolutionAnother less straight forward solution:
=(1-MMULT({0.35,1},COUNTIF(D3,{"*CR*";"*INV*"})))*I3