Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Error in IF, OR, AND formula

Topic Labels: Formulas
Solved
Jump to Solution
326 5
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Everyone,

I’m currently working on what feels like it should be a relatively simple formula, but I’m consistently getting a #ERROR! result when I try to implement it.

Context is: I have a table that lists students’ work experiences, their start dates and end dates. I want a filtered list of records where either the start date or end date was in the month before the previous month. e.g. if I was looking at it at the end of May, I’d want to see all work experience that started or ended in the month of April.

This is the formula I’ve written:

IF(
OR(
AND(
{Start Date}>(DATEADD(TODAY(),-60,’days’)),
{Start Date}<(DATEADD(TODAY(),-30,’days’))
)=1
,
AND(
{End Date}>(DATEADD(TODAY(),-60,’days’)),
{End Date}<(DATEADD(TODAY(),-30,’days’))
)=1
)
=1,TRUE(),FALSE())

As I said, I’m getting a consistent error message on this formula. Apologies if I’ve missed something incredibly simple, but would anyone be able to cast a fresh pair of eyes over this and point out any mistakes I’ve made?

Thanks so much for your help!

1 Solution

Accepted Solutions

Second fix:
Formula parser doesn… …t appreciate typographic niceties - replace those closing quotes with simple, rough apostrophes.

See Solution in Thread

5 Replies 5

Hey Thomas,
I’m not sure how the formula parser is interpreting the ‘=1’ next to each condition, but you need to drop them. The ‘=1’ (as a True) is implicit in the AND() and OR() operators.

Thanks for explaining that. I’ll admit I was a little perplexed about if I needed the ‘=1’ or not.

Unfortunately still getting the #ERROR! result though :frowning_face:

Second fix:
Formula parser doesn… …t appreciate typographic niceties - replace those closing quotes with simple, rough apostrophes.

That fixed it! Thanks Grunty!

The source of the problem is me writing out my formula in a separate notes app, and then copying and pasting it in. Retyping the apostrophes in Airtable seemed to fix the issue.

If your notes app defaults to styled text, that would explain the problem. It’s best to use a plain text editor—or better yet, a dedicated code editor—when developing formulas outside of Airtable so that styled quotes will never be an issue.