Option to enter data in different unit field and calculate the other field

398
3
09-17-2018 05:53 AM
AJM
by
New Contributor III

Is is possible to have the option to enter data in a field OR have it calculated from another field? Users can  record measurements in inches or centimeters. If they enter it in the inches field I would like to it calculate centimeters and storage that in the centimeters field and vis versa. I know I can create cal field and store the data there, but I would rather only have the data in 2 fields if possible. 

0 Kudos
3 Replies
deleted-user-qpvAI3Fo0MKR
Occasional Contributor III

The short answer is yes. You'll need to add a field called calculation to your questions sheet...xlsform.org/calculation

0 Kudos
AJM
by
New Contributor III

I was not able to do it with only 2 fields but added a 3rd calculated field based on the select units field to hold the result

if(selected(${tape_units}, 'cm') ,${c_min_cm},(${c_min_in}*2.54))

0 Kudos
deleted-user-qpvAI3Fo0MKR
Occasional Contributor III

That sounds correct - you'll need one field to hold the values in metric, one to hold the values in imperial, and a field for your if/calculation statement.You could use a SelectOne to force your users to let you know what system they're using, and if they select imperial then you do the conversion.

0 Kudos