Thank you for such a quick response.
I sort of understand how to use your solution if I were calculating the total sum. It isn’t exactly what I am trying to do. You can see it in action at https://hrsoftware.app/kbs-connector-pricing-calculator.
I am working on the toggle version. I have checkbox at the top that lists each product. I can set each value to a number if that is easier?
Option1: slice
Option 2: sync
Option 3: invoice
If option 1 is not selected, I would like the “slice” monthly calculation to be set to 0, otherwise, I would like to calculate the price.
Below is the calculation I have so far…but it only works if one option is toggled.
Calculation Field 1
(function(){
let result = fieldname3;
if(IN('slice', fieldname3|r)) result = 1;
if(fieldname3<1) return PREC(fieldname1*0,2);
if(fieldname1<1) return PREC(fieldname1*0,2);
if(fieldname1>0 & fieldname1<100) return PREC(fieldname1*0.65,2);
if(fieldname1>99 & fieldname1 <250 ) return PREC(fieldname1*0.55,2);
if(fieldname1>249 & fieldname1 <500 ) return PREC(fieldname1*0.40,2);
if(fieldname1>499 & fieldname1 <750 ) return PREC(fieldname1*0.35,2);
if(fieldname1>749 & fieldname1 <1000 ) return PREC(fieldname1*0.22,2);
if(fieldname1>999 & fieldname1 <2000) return PREC(fieldname1*0.15,2);
if(fieldname1>1999 & fieldname1 <3500) return PREC(fieldname1*0.08,2);
if(fieldname1>3499 & fieldname1 <5000) return PREC(fieldname1*0.05,2);
if(fieldname1>4999 & fieldname1 <6500) return PREC(fieldname1*0.04,2);
if(fieldname1>6499) return PREC(fieldname1*0.03,2);
})();
Calculation Field 2
(function(){
let result = fieldname3;
if(IN('sync', fieldname3|r)) result = 1;
if(fieldname3<1) return PREC(fieldname1*0,2);
if(fieldname2==0) return PREC(fieldname2*0,2);
if(fieldname2>0 & fieldname2<100) return PREC(fieldname2*1,2);
if(fieldname2>99 & fieldname2 <200 ) return PREC(fieldname2*0.90,2);
if(fieldname2>199 & fieldname2 <350 ) return PREC(fieldname2*0.75,2);
if(fieldname2>349 & fieldname2 <500 ) return PREC(fieldname2*0.55,2);
if(fieldname2>499 & fieldname2 <750 ) return PREC(fieldname2*0.5,2);
if(fieldname2>749 & fieldname2 <1000 ) return PREC(fieldname2*0.45,2);
if(fieldname2>999) return PREC(fieldname2*0.35,2);
})();
Calculation Field 3
Calculation Field 3
(function(){
let result = fieldname3;
if(IN('ar', fieldname3|r)) result = 1;
if(fieldname3<1) return PREC(fieldname1*0,2);
if(fieldname4==0) return PREC(fieldname4*0,2);
if(fieldname4>0 & fieldname4<100) return PREC(fieldname4*0.85,2);
if(fieldname4>99 & fieldname4 <250 ) return PREC(fieldname4*0.75,2);
if(fieldname4>249 & fieldname4 <500 ) return PREC(fieldname4*0.65,2);
if(fieldname4>499 & fieldname4 <750 ) return PREC(fieldname4*0.45,2);
if(fieldname4>749 & fieldname4 <1000 ) return PREC(fieldname4*0.40,2);
if(fieldname4>999 & fieldname4 <1250) return PREC(fieldname4*0.35,2);
if(fieldname4>1249 & fieldname4 <1500) return PREC(fieldname4*0.3,2);
if(fieldname4>1499 & fieldname4 <1750) return PREC(fieldname4*0.25,2);
if(fieldname4>1749) return PREC(fieldname4*0.2,2);
})();
I