I'm trying to add some calculations that take two variables to determine a designated output into a form.
Can I set up a formula or script that runs off of a lookup table to complete these? For example. From the first drop-down you select the color blue, the second drop-down you select 25, then in the third box it auto fills "apple". Like the table below, the result is based on checking the first and second columns to determine the output in the third.
| Color | Number | Word |
|---|---|---|
| Blue | 25 | Apple |
| Red | 16 | Orange |
| Blue | 16 | Peach |
| Red | 25 | Pineapple |
I'm thinking that when I do the third field I'd use a loop script for the calculation.
(I don't know any javascript yet)
if (Box Color = Blue)
if (Box Number =25)
then Box result = Word
else if (Box Number =16)
then Box result = Peach
else if (Box Color = Red)
if (Box Number = 25)
then Box result = Pineapple
else if (Box Number = 16)
then Box result = Orange
else Box result = " "
Is this along the right lines? Or is there a better way? Considering the data tables I'm using are more extensive than the example above.
