I am trying to use an IF / ELSEIF formula in FormCalc to autopopulate a text field in a table, but I keep getting a syntax error. Could someone please help?
My table has 2 rows and 2 columns. I named each cell (using Binding) in Column 1 as Data1 and Data2 respectively. Both cells in Column 1 contain a dropdown menu of numbers 1, 2, and 3. I want to create a FormCalc IF expression in Column 2 so that when the user selects a "1" in the Data1 cell, the cell adjacent to it in Column 2 autopopulates to "Yes". Then if they select a "2", the adjacent cell becomes "No", and if they select a "3", the adjacent cell is "Unknown". Then, I want to do the same thing for the Data2 cell and its adjacent cell in Column 2.
Here is the expression that I've tried using for the first row (it doesn't work). (The second row in Column 2 [next to Data2] has the same formula, except Data1 is replaced with Data2.)
if (Data1 = 1) then
"Yes"
elseif (Data1 = 2) then
"No"
elseif (Data1 = 3) then
"Unknown"
endif
Can anyone spot where my syntax error is and how to fix it? I'd really appreciate it! Thanks!
My table has 2 rows and 2 columns. I named each cell (using Binding) in Column 1 as Data1 and Data2 respectively. Both cells in Column 1 contain a dropdown menu of numbers 1, 2, and 3. I want to create a FormCalc IF expression in Column 2 so that when the user selects a "1" in the Data1 cell, the cell adjacent to it in Column 2 autopopulates to "Yes". Then if they select a "2", the adjacent cell becomes "No", and if they select a "3", the adjacent cell is "Unknown". Then, I want to do the same thing for the Data2 cell and its adjacent cell in Column 2.
Here is the expression that I've tried using for the first row (it doesn't work). (The second row in Column 2 [next to Data2] has the same formula, except Data1 is replaced with Data2.)
if (Data1 = 1) then
"Yes"
elseif (Data1 = 2) then
"No"
elseif (Data1 = 3) then
"Unknown"
endif
Can anyone spot where my syntax error is and how to fix it? I'd really appreciate it! Thanks!