Can't use IF function in New Quiz

Jump to solution
AnandaGanguly
Community Explorer

The documentation states that that Canvas Helper functions include the IF function, as long as the conditional first part is boolean: i.e., if it evaluates to anything other than 0, the condition is considered TRUE and if it evaluates to 0, the condition is considered FALSE.

Okay, but I am unable to make this (simplified version of what I am doing) work:

X=IF((cmXperLR - cmYperLR)+ABS(cmXperLR - cmYperLR), demandX, demandY)

[cmXperLR, cmYperLR, demandX and demandY are previusly defined/calculated variables.]

I even tried an arbitrary formula like this:

IF(2-3-abs(2-3),9,99)

In either case, I get an "Invalid Formula" error message.

I also checked this archived thread suggesting it should work: https://community.canvaslms.com/t5/Archived-Questions/ARCHIVED-Using-IF-statements-in-Formula-Questi...

Help!

-Ananda

Labels (1)
0 Likes
1 Solution
Gabriel33
Community Participant

Please try it with lowercase "if" instead of "IF".

The formula question instructions mention that variable names are case sensitive, but not formula names, seems like a small oversight, but they are all listed in lowercase, and using "if" worked for me.

 

View solution in original post