Help

If both date fields contain a value, return "available"

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

Hi there,

I have accomplished a few formulas through my airtable base but I have trouble with this one:
In a library, I want to return “not in stock” for items that are signed out and have not yet been returned.

In writing this would be:

If SignOutDate contains a value and ReturnDate contains no value, return “not in stock”, otherwise “available”

IF(
AND(
{SignOutDate}<>””,{ReturnDate}=BLANK()
),
”notinstock”,”available”
)

As I am new to the AND/IF business, I might have severe problems in here already? If not, could it be that the date fields are the problem, they are set as ISO?

Any help highly appreciated.

Best, Sisi

image

1 Solution

Accepted Solutions

Welcome to the Airtable community!

Airtable formula fields have their own grammar and vocabulary, different from other formula writing systems you may have used. For example <> is not a valid comparison operator in Airtable formulas.

There are also multiple methods of checking if a field has a value, but one of the easiest is to simply use the {field} itself as a test. If the field has a value, it will be “true”, with a few exceptions for number fields.

IF(
    AND(
        {SignOutDate},
        NOT({ReturnDate})
    ),
    "notinstock",
    "available"
)

See Solution in Thread

2 Replies 2

Welcome to the Airtable community!

Airtable formula fields have their own grammar and vocabulary, different from other formula writing systems you may have used. For example <> is not a valid comparison operator in Airtable formulas.

There are also multiple methods of checking if a field has a value, but one of the easiest is to simply use the {field} itself as a test. If the field has a value, it will be “true”, with a few exceptions for number fields.

IF(
    AND(
        {SignOutDate},
        NOT({ReturnDate})
    ),
    "notinstock",
    "available"
)

Thank you so much, kuovonne.
This worked perfectly and ended my two days of head-scratching.

It´s the first time I ever posted anything in a forum in my life - how lovely, it what such a success.
You just made my day. Thanks so much!

Labels