Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculating multiple answers

Featured Replies

Hey guys,

I have several fields that I am trying to combine into one field that would provide multiple answers based on the choices of the other fields. For example say I have 3 fields with radio buttons.

First field is "How many times have you voted" choices are "None, 1, 2, 3 or more".

Second field "What party do you affiliate yourself with?" choices are "Republican or Democrat"

Third field "Have you ever worked for the government" choices are "yes or no"

Now I have a calculation field that I want to return one answer for all of these questions.. (i.e. if "1, Republican and no" were chosen then it would show "Voted once, as republican, never worked for government" or if "none" was selected then it would return "never voted" etc...)

This is what I have so far but I am getting a "0" as the return:

If ( HowManyTimesVoted = "None"; "Never voted"; " ") or if (HowManyTimesVoted = "1" & PolicticalParty ="Republican" & WorkedForGovt = "No";"Voted once, as republican, never worked for government"; " ")

Please help.

Thanks

Hey guys,

I have several fields that I am trying to combine into one field that would provide multiple answers based on the choices of the other fields. For example say I have 3 fields with radio buttons.

First field is "How many times have you voted" choices are "None, 1, 2, 3 or more".

Second field "What party do you affiliate yourself with?" choices are "Republican or Democrat"

Third field "Have you ever worked for the government" choices are "yes or no"

Now I have a calculation field that I want to return one answer for all of these questions.. (i.e. if "1, Republican and no" were chosen then it would show "Voted once, as republican, never worked for government" or if "none" was selected then it would return "never voted" etc...)

This is what I have so far but I am getting a "0" as the return:

If ( HowManyTimesVoted = "None"; "Never voted"; " ") or if (HowManyTimesVoted = "1" & PolicticalParty ="Republican" & WorkedForGovt = "No";"Voted once, as republican, never worked for government"; " ")

Please help.

Thanks

Make sure your calculation is set to return text and not number.

I suggest you use the Case() function for this. Also, you need to use the logical operator and instead of the text concatenation operator &.

This could be simplified if you don't require the response to be completely prosaic and grammatically perfect.


Case ( 



HowManyTimesVoted = "None"; 

"Never voted" ; 



"Voted " & HowManyTimesVoted & " times, as " & PolicticalParty & ", " & Case ( WorkedForGovt = "No" ; "never worked for government" ; "worked for government" )



)

You can make the function return fancier (more prosaic) results but you'll get to the stage where you'll be special-casing practically every permutation of answers. You are better off forming the question and answer in a way that it makes sense when summarised in a simple calculation.

Quite aside, as an Australian the concept of people not voting is strange because voting here is compulsory. (Technically people don't have to vote but they do have to attend a polling booth: they can choose to lodge an "informal" vote if they wish which does not count.) The compulsory vote places responsibility on both the voter and the Government itself: it is required by law to get the vote from every single Australian citizen including those overseas, in remote locations (and down here we have some seriously remote locations) and those in prison serving a sentence of 3 years or less. This prevents the government from disenfranchising groups of people from their democratic rights. ;)

  • Author

This worked perfectly, thank you.

This could be simplified if you don't require the response to be completely prosaic and grammatically perfect.


Case ( 



HowManyTimesVoted = "None"; 

"Never voted" ; 



"Voted " & HowManyTimesVoted & " times, as " & PolicticalParty & ", " & Case ( WorkedForGovt = "No" ; "never worked for government" ; "worked for government" )



)

You can make the function return fancier (more prosaic) results but you'll get to the stage where you'll be special-casing practically every permutation of answers. You are better off forming the question and answer in a way that it makes sense when summarised in a simple calculation.

Quite aside, as an Australian the concept of people not voting is strange because voting here is compulsory. (Technically people don't have to vote but they do have to attend a polling booth: they can choose to lodge an "informal" vote if they wish which does not count.) The compulsory vote places responsibility on both the voter and the Government itself: it is required by law to get the vote from every single Australian citizen including those overseas, in remote locations (and down here we have some seriously remote locations) and those in prison serving a sentence of 3 years or less. This prevents the government from disenfranchising groups of people from their democratic rights. ;)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.