Help

Re: Formula with OR and AND criteria

Solved
Jump to Solution
895 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Cody_Winchester
6 - Interface Innovator
6 - Interface Innovator

I have a Learning Course table that tracks courses with either a single session or dual sessions via checkbox fields. I have links to fields in this table that identify whether an enrollee has completed the relevant sessions(s). From there I have a checkbox field that indicates whether, based on the attendance, whether an enroll has effectively completed the course. I tested a formula field that runs the checkbox field for the dual session completion, but I’m struggling to create a formula that accounts for the single session field. I initially thought it was an IF(OR(AND())) type of configuration but nothing seems to work. Here’s what I tried:

Works:

IF(AND({Session 000 Output}>0,{Session 001 Output}>0),{<TRIGGER> Completed Course}=1,{<TRIGGER> Completed Course}=0)

Doesn’t Work:

IF(AND({Single Session}=1,{Session 000 Output}>0),IF(AND({Dual Sessions}=1,{Session 000 Output}>0,{Session 001 Output}>0)),<{<TRIGGER> Completed Course}=1,<{<TRIGGER> Completed Course}=))

IF(AND({Single Session (from Workshop)}=1,{Session 000 Output}>0),<{<TRIGGER> Completed Course}=1,IF(AND({Dual Sessions (from Workshop)}=1,{Session 000 Output}>0,{Session 001 Output}>0),{<TRIGGER> Completed Course}=1,{<TRIGGER> Completed Course}=0))
IF(OR(IF(AND({Single Session (from Workshop)}=1,{Session 000 Output}>0),IF(AND({Dual Sessions (from Workshop)}=1,{Session 000 Output}>0,{Session 001 Output}>0),<{<TRIGGER> Completed Course}=1,<{<TRIGGER> Completed Course}=0))))
IF(AND({Single Session (from Workshop)}=1.{Session 000 Output}>0),OR(AND({Dual Sessions (from Workshop)},{Session 000 Output}>0,{Session 001 Output}>0)),<{<TRIGGER> Completed Course}=1,<{<TRIGGER> Completed Course}=0)
1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

Your nesting and syntax isn’t quite lining up. You don’t need so many IF statements, just 1 IF(), 1 OR(), and 2 AND() nested properly. I think the syntax you’re looking for is:

IF(
  OR(
    AND({Single Session (from Workshop)}=1,{Session 000 Output}>0),
    AND({Dual Sessions (from Workshop)}=1,{Session 000 Output}>0,{Session 001 Output}>0)
  ),
  "true",
  "false"
)

See Solution in Thread

2 Replies 2
Kamille_Parks
16 - Uranus
16 - Uranus

Your nesting and syntax isn’t quite lining up. You don’t need so many IF statements, just 1 IF(), 1 OR(), and 2 AND() nested properly. I think the syntax you’re looking for is:

IF(
  OR(
    AND({Single Session (from Workshop)}=1,{Session 000 Output}>0),
    AND({Dual Sessions (from Workshop)}=1,{Session 000 Output}>0,{Session 001 Output}>0)
  ),
  "true",
  "false"
)

I ended up figuring it out just as you showed! Thanks for your reply! Also, I was trying to drive a checkbox field so that was an additional error.