Just think of $iif() as if-then-else
If you already know the if-then-else, which I know you do, the $iif() should be a piece of cake.