Share via

Error using iif function

Anonymous
2024-03-16T21:59:45+00:00

When using the iif function I get an error that says 'you omitted an operand or operator, you entered an invalid character or comma, or you entered text without surrounding it in quotation marks'. I get this even when I try:

iif((1+1=2),"yes","no")

I've been working on this for a few hours, trying different things. I called MS support and apparently this is the only forum to get help. Having that function for the work I'm doing is critical. Any suggestions please?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

24 answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2024-03-17T13:09:43+00:00

    Try changing the list separator to a comma.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-03-16T22:28:49+00:00

    Also should mention I'm on version 2402.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-03-16T22:23:56+00:00

    I use commas but I also tried semicolons based on advice in a prior posting and that didn't work. Plus in the expression builder when typing =iif, it shows what the expression should look like and appears to show pipe delimiters ( | ) between the condition and the results but that didn't work either.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-03-16T22:21:32+00:00

    Also, forgot the '=' in my message above, should have written:

    =iif((1+1=2),"yes","no")

    Appreciate whatever help you can provide.

    Was this answer helpful?

    0 comments No comments
  5. HansV 462.6K Reputation points
    2024-03-16T22:11:01+00:00

    Do you use comma as decimal separator? If so, use semicolons between the arguments:

    IIf(1+1=2; "yes"; "no")
    

    Was this answer helpful?

    0 comments No comments