Cognito-forms – How to calculate using cognito form choices from radio button

cognito-forms

I have just started using cognito forms and have hit a brick wall as I am not a pro when it comes to formulas.

I have a section that has (5) Radio button choices with the following titles;
2' x 2' 2' x 4' 4' x 4' 4' x 6' 4' x 8'

when one of these buttons is selected for example number (2) 2' x 4' I would like to take the answer to that which is 8 and multiply that number by another field which has asked for the quantity.

another example is someone types in the quantity field (6) and then they select radio button number (5) which is 4' x 8' the answer to this formula needs to be (4' x 8')*(6) = 192

Best Answer

You can do this with a calculation:

=(
   if Size = "2' x 2'" then 4 else
   if Size = "2' x 4'" then 8 else
   if Size = "4' x 4'" then 16 else
   if Size = "4' x 6'" then 24 else
   if Size = "4' x 8'" then 32 else 0
 )
 *
 Quantity

We are considering allowing you to assign numeric values to choices in Cognito Forms, which would make this even easier, but this approach will definitely meet your needs!