Calculated fields : selecting multiple checkboxes to get a total value
I have a custom form with Field 1 as a dropdown and Field 2 as a single line text to input the quantity required (of Field 1). This formula works:
{DE:Field1}*{DE:Field2} and gives me a total. Happy.
Now I would like to have Field 1 as a multi checkbox with 5 options and each option has a value associated to it. Depending on which option/s are selected in Field1, a single line text field will then appear to input a quantity for each of the 5 options selected.
I want to update my calculated field to now give me a total value of Field 1 x Field 2 PLUS any of the other options.
I found this as a test, but it gives me invalid expression.
IF(CONTAINS("Field1Option1", (DE:Field1}), {DE:Field2}*value1,0)+
IF(CONTAINS("Field1Option2", (DE:Field1}), {DE:Field2}*value2,0)
And this one gives me 0:
IF(CONTAINS("Field1Option1", (DE:Field1})*{DE:Field2},0)+
IF(CONTAINS("Field1Option2", (DE:Field1})*{DE:Field2},0)
Please can someone help? I get so far and then I am stuck. Thank you!