IF OR statement with multiple ORs

Options
ClassicSarah
ClassicSarah ✭✭
edited 08/17/22 in Formulas and Functions

The following statement works...

=IF(OR([Commission Structure]@row = "HouseAcct-Estimator", [Commission Structure]@row = "Est & AM Shared", [Commission Structure]@row = "BizDev&Est"), 0.1 * [Profit before Commissions]@row, 0)

But, when I try to add a second OR I get unparseable error.

=IF(OR([Commission Structure]@row = "HouseAcct-Estimator", [Commission Structure]@row = "Est & AM Shared", [Commission Structure]@row = "BizDev&Est"), 0.1 * [Profit before Commissions]@row, ([Commission Structure]@row = "Jr Est & Est Shared"),0.05*[Profit before Commissions]@row), 0)

How do I fix the error?

Best Answer

  • Sameer Karkhanis
    Sameer Karkhanis ✭✭✭✭✭✭
    Answer ✓
    Options

    I believe you are trying to say that if the first OR condition is true then calculate 0.1 times profit before commissions, else if commission structure is "Jr Est & Est Shared" then calculate 0.05 times of the profit before commission else return 0. In that case its not a OR condition, it is else if condition, and the formula should written be as shown below,

    =IF(OR( [Commission Structure]@row = "HouseAcct-Estimator", 
    	[Commission Structure]@row = "Est & AM Shared", 
    	[Commission Structure]@row = "BizDev&Est"
          ), 
    	0.1 * [Profit before Commissions]@row, 
    	IF([Commission Structure]@row = "Jr Est & Est Shared", 0.05*[Profit before Commissions]@row, 0)
    )
    

Answers

  • Sameer Karkhanis
    Sameer Karkhanis ✭✭✭✭✭✭
    Answer ✓
    Options

    I believe you are trying to say that if the first OR condition is true then calculate 0.1 times profit before commissions, else if commission structure is "Jr Est & Est Shared" then calculate 0.05 times of the profit before commission else return 0. In that case its not a OR condition, it is else if condition, and the formula should written be as shown below,

    =IF(OR( [Commission Structure]@row = "HouseAcct-Estimator", 
    	[Commission Structure]@row = "Est & AM Shared", 
    	[Commission Structure]@row = "BizDev&Est"
          ), 
    	0.1 * [Profit before Commissions]@row, 
    	IF([Commission Structure]@row = "Jr Est & Est Shared", 0.05*[Profit before Commissions]@row, 0)
    )
    

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!