Formulas

CODAP Forums CODAP Help Forum Formulas

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #467 Score: 0
    Randy Kochevar
    Participant

    In CODAP, is it possible to write a multi-step logic formula? I’d like to create a formula of the form: If x<=10, fLW=6.6; if x=11, fLW=1.9; if x=12, fLW=0. Is there a way to do that with the formula editor? (I realize that I might need to do it in two separate operations, which would be okay but not ideal.)

    #469
    Bill Finzer
    Keymaster

    Hi Randy,

    Yes, it is possible, and with a single formula (though perhaps not as elegant as one would wish). The screen shot shows how, using attributes x and fLW. It’s basically a nested ‘if/else’. Notice that there’s no last else clause so when x is 13, fLW gets no value.

    if(x<=10, 6.6,
    if(x=11, 10,
    if(x=12,0)))

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.