Discussions

View Only

Convert yes/no multiple choice to numerical value?

• 1.  Convert yes/no multiple choice to numerical value?

Posted 14 days ago
Is there a way to convert text into numerical values?  What I am trying to do is have several fields where the choices can either be yes, no or NA.  I want each of these to assign a numerical value.

for example:

field one: yes = 30, n = 0, na = 30
field two: yes = 30, n = 0, na = 30
field three:  yes = 40, n = 0, na = 40

Then I want a field at the end which gives the percentage ... so if field 1 was yes, field 2 was no and field 3 was yes the score would be 70%.  Attached a mockup screenshot of what I mean.  Thanks.

------------------------------
William
------------------------------

• 2.  RE: Convert yes/no multiple choice to numerical value? Best Answer

Posted 14 days ago
No problem, you can make a formula numeric field set to display as a percentage and do the calculations all in one field.

var number FieldOneScore = Case([Field One],
"yes",30,
"n",0,
"na",30);

var number FieldTwoScore = Case([Field Two],
"yes",30,
"n",0,
"na",30);

var number FieldThreeScore = Case([Field Three],
"yes",40,
"n",0,
"na",40)

(\$FieldOneScore + \$FieldTwoScore + \$FieldThreeScore) / 100

------------------------------
mark.shnier@gmail.com
------------------------------

• 3.  RE: Convert yes/no multiple choice to numerical value?

Posted 13 days ago
Great, that worked.  Thanks Mark.  Any idea how I can make that field display as a percentage?  Right now it displays as a decimal (like 0.5) but I would like it to say 50%.

------------------------------
William
------------------------------

• 4.  RE: Convert yes/no multiple choice to numerical value?

Posted 13 days ago
No problem, you can make the formula numeric field set to display as a percentage.  That is a setting on the Field Properties.

------------------------------