Public Function IIF(ExpressionLeft, Condition, ExpressionRight, TruePart, FalsePart)
    Select Case Condition
        Case "<>"
            If ExpressionLeft <> ExpressionRight Then
                IIF = TruePart
            Else
                IIF = FalsePart
            End If
        Case ">"
            If ExpressionLeft > ExpressionRight Then
                IIF = TruePart
            Else
                IIF = FalsePart
            End If
        Case ">="
            If ExpressionLeft >= ExpressionRight Then
                IIF = TruePart
            Else
                IIF = FalsePart
            End If
        Case "<"
            If ExpressionLeft < ExpressionRight Then
                IIF = TruePart
            Else
                IIF = FalsePart
            End If
        Case "<="
            If ExpressionLeft <= ExpressionRight Then
                IIF = TruePart
            Else
                IIF = FalsePart
            End If
        Case Else
            If ExpressionLeft = ExpressionRight Then
                IIF = TruePart
            Else
                IIF = FalsePart
            End If
    End Select
End Function