# Re: Formula limit? airtable shortens my formula?

638 0
cancel
Showing results for
Did you mean:
4 - Data Explorer

is there a formula limit in airtable? i wish to compute for the payment rental reminder. could be every 2 months or every 3 months. but upon saving, airtable is shortening it to half of what i type. what’s happening?

IF(AND(FIND(“Bank Transfer Regular”, {Payment Term}), Status= “Active”),SWITCH(AND(FIND(“2 months advance”, {Payment Term}),{Contract Start}< DATEADD({Contract Start}, 2, ‘month’)), DATETIME_FORMAT(DATEADD({Contract Start}, 2, ‘month’),‘MM-DD-YYYY’)),

4 Replies 4
11 - Venus

I’ve written a much longer formula than the one you provided and haven’t encountered the same issue.

I do, however, think I see what the problem is.
It seems that you’re trying to create a nested IF formula.

Here’s the exact same formula you posted but with a bit of formatting:

``````IF(
AND(
FIND(
“Bank Transfer Regular”,
{Payment Term}
),
Status = “Active”
),
SWITCH(
AND(
FIND(
{Payment Term}
),
{Contract Start} < DATEADD({Contract Start}, 2, ‘month’)
),
DATETIME_FORMAT(
‘MM-DD-YYYY’
)
),
SWITCH(
AND(
FIND(
{Payment Term}
),
TODAY() > DATEADD({Contract Start}, 2, ‘month’),
TODAY() < DATEADD({Contract Start}, 4, ‘month’)
),
DATETIME_FORMAT(
‘MM-DD-YYYY’
)
),
SWITCH(
AND(
FIND(
{Payment Term}
),
TODAY() > DATEADD({Contract Start}, 4, ‘month’),
TODAY() < DATEADD({Contract Start}, 6, ‘month’)
),
DATETIME_FORMAT(
‘MM-DD-YYYY’)
),
SWITCH(
AND(
FIND(
{Payment Term}
),
TODAY() > DATEADD({Contract Start}, 6, ‘month’),
),
DATETIME_FORMAT(
‘MM-DD-YYYY’
)
),
SWITCH(
AND(
FIND(
{Payment Term}
),
TODAY() > DATEADD({Contract Start}, 8, ‘month’),
),
DATETIME_FORMAT(
)
)
)
``````

The IF formula syntax is: `IF(statement, a, b)`.
There’s a few errors, but the main reason for the formula failure is that you wrote the formula in this syntax: `IF(condition, a, b, c, d, e)`.

Here’s a version of your formula that fits within the formula syntax.
I have also refactored the formula body to be a bit more efficient in its flow.

``````IF(
AND(
FIND(
“Bank Transfer Regular”,
{Payment Term}
),
FIND(
{Payment Term}
),
{Status} = “Active”
),
IF(
{Contract Start} < DATEADD({Contract Start}, 2, 'month'),
DATETIME_FORMAT(
'MM-DD-YYYY'
),
IF(
AND(
TODAY() > DATEADD({Contract Start}, 2, 'month'),
TODAY() < DATEADD({Contract Start}, 4, 'month')
),
DATETIME_FORMAT(
'MM-DD-YYYY'
),
IF(
AND(
TODAY() > DATEADD({Contract Start}, 4, 'month'),
TODAY() < DATEADD({Contract Start}, 6, 'month')
),
DATETIME_FORMAT(
'MM-DD-YYYY'
),
IF(
AND(
TODAY() > DATEADD({Contract Start}, 6, 'month'),
TODAY() < DATEADD({Contract Start}, 8, 'month')
),
DATETIME_FORMAT(
'MM-DD-YYYY'
),
IF(
AND(
TODAY() > DATEADD({Contract Start}, 8, 'month'),
TODAY() < DATEADD({Contract Start}, 10, 'month')
),
DATETIME_FORMAT(
'MM-DD-YYYY'
)
)
)
)
)
)
)
``````

You should be able to just copy and paste that into your formula field to see how it behaves.
I do recommend that you check to make sure that the formatting on your field names is correct, or else it will toss you an error.

Let me know if I’m misunderstanding something or if something breaks with the formula.
Definitely feel free to let me know if you have any questions!

Edited for clarity

18 - Pluto

The version of the formula that I see has curly quotes in places that need straight quotes.

I haven’t actually read the formula, and it seems to have a lot going on. (It looks inside-out to me.) I just wanted to give this warning.

11 - Venus

Yeah… the formula is relatively dense.
I spent a bit too long last night pulling it apart and cleaning it.

@East_Lima_Realty - Kuovonne is correct. I tend to get lazy in my formulas and code when it comes to my quotes; keep an eye out for them if you try to use the formula.

12 - Earth
``````IF(AND(
FIND("Bank Transfer Regular",{Payment Term}),