Skip to main content
Question

Formula "Self-Changing" to Something Else

  • April 21, 2026
  • 6 replies
  • 76 views

siliceous
Forum|alt.badge.img+10

Hi all,

I am having trouble with a nested “IF” formula which I believe is correct because when I enter it into the formula field, it is accepted and saved. However, when I then click on “Edit field” to view the formula, it has “self-changed” the formula to something else.

 

This is my original formula which the formula field is accepting:

IF({Transaction Status} = "Order Filled", IF({Transaction Type} = "Sell", ({Total Cryptocurrency Value USDT}-({Value per Buy Cryptocurrency USDT (from Linked Buy Transaction (From field: Linked Sell Transactions))} * {Amount of Cryptocurrency})) * 0.35), IF({Transaction Type} = "Buy", IF({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} = {Total Cryptocurrency Value USDT}, ({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)})-{Total Cryptocurrency Value USDT}) * 0.35, IF({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} < {Total Cryptocurrency Value USDT}), 'Trade in progress', IF({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} > {Total Cryptocurrency Value USDT})), 'Miscalculation')

 

After I click “Save” and “Edit field” to view the formula, this is what comes up:

IF({Transaction Status} = "Order Filled", IF({Transaction Type} = "Sell", ({Total Cryptocurrency Value USDT}-({Value per Buy Cryptocurrency USDT (from Linked Buy Transaction (From field: Linked Sell Transactions))} * {Amount of Cryptocurrency})) * 0.35), IF({Transaction Type} = "Buy", IF({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} = {Total Cryptocurrency Value USDT}, ({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)})-{Total Cryptocurrency Value USDT}) * 0.35, IF({Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} < {Total Cryptocurrency Value USDT}))) 

 

For some reason, it is automatically removing the last bits of the “if” statements which include the phrases ‘Trade in progress’ and ‘Miscalculation’ (italicised in the original formula above). The calculation it does for the “Sell” if statement is correct so it makes no sense why it is saving the formula then changing it to something else. Seems like some kind of Airtable bug.

Any help would be appreciated.

6 replies

Melissa_Hanson
Forum|alt.badge.img+4
  • Participating Frequently
  • April 22, 2026

Looks like you’ve just got some nesting issues with the IF statements. Airtable is attempting to correct so that’s why it changes. (Full disclosure - I asked ChatGPT.)


TheTimeSavingCo
Forum|alt.badge.img+32

Hm yeah, I would recommend adding line breaks and tabs to formulas to make them easier to debug

Here’s what your formula looks like:

IF(
{Transaction Status} = "Order Filled",
IF(
{Transaction Type} = "Sell",
(
{Total Cryptocurrency Value USDT} -
(
{Value per Buy Cryptocurrency USDT (from Linked Buy Transaction (From field: Linked Sell Transactions))} *
{Amount of Cryptocurrency}
)
) *
0.35
),
IF(
{Transaction Type} = "Buy",
IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} = {Total Cryptocurrency Value USDT},
(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)}) -
{Total Cryptocurrency Value USDT}
) *
0.35,
IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} < {Total Cryptocurrency Value USDT}),
'Trade in progress',
IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} > {Total Cryptocurrency Value USDT}
)
),
'Miscalculation'
)

There are a couple of extra ‘)’s and the ‘Miscalculation’ line isn’t inside an ‘IF’, which seems like a typo?

Try this:

IF(
{Transaction Status} = "Order Filled",
IF(
{Transaction Type} = "Sell",
(
{Total Cryptocurrency Value USDT} -
(
{Value per Buy Cryptocurrency USDT (from Linked Buy Transaction (From field: Linked Sell Transactions))} *
{Amount of Cryptocurrency}
)
) *
0.35
),
IF(
{Transaction Type} = "Buy",
IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} = {Total Cryptocurrency Value USDT},
(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} -
{Total Cryptocurrency Value USDT}
) *
0.35,
IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} < {Total Cryptocurrency Value USDT},
'Trade in progress',
IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} > {Total Cryptocurrency Value USDT},
'Miscalculation'
)
)
)
)
)

 


siliceous
Forum|alt.badge.img+10
  • Author
  • Inspiring
  • April 22, 2026

@TheTimeSavingCo,

Thanks for your reply.

I copied and pasted your version of the code into the formula field, and this time it did not “self-change” the code but where there is supposed to be the text “Trade in progress” for a particular record, it doesn’t show anything. So I’m thinking there is still something wrong with the way the IF statements are nested, or Airtable still isn’t liking the formula. As I can see it, it looks fine to me.


TheTimeSavingCo
Forum|alt.badge.img+32

Hmm, your formula currently checks the following: 

{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} = {Total Cryptocurrency Value USDT}

And if that’s true, it then does this:

IF(
{Total Sell Transaction Values USDT (from Linked Sell Transactions from Transactions)} < {Total Cryptocurrency Value USDT},
'Trade in progress',

And this means that ‘Trade in progress’ can never show up, right? 


siliceous
Forum|alt.badge.img+10
  • Author
  • Inspiring
  • April 23, 2026

@TheTimeSavingCo

I think I have worked out what the problem is with a bit of troubleshooting, but I still can’t find a solution to the problem.

What I did was I switched the positioning of the IF statements for the “Buy” and the “Sell” portions of the formula. So when the “Sell” portion of the formula was at the top (just under the “Order Filled” IF statement), it worked out the Sell amount but not the text for the Buy portion of the formula.

When I switched the formula and placed the “Buy” portion of the formula at the top (above the “Sell” portion and under the “Order Filled” IF statement), then it worked out the “Trade in Progress” text correctly, but no longer showed the amount for the Sell portion of the formula.

So, it is not calculating both the Sell and Buy portions concurrently - only one at a time.

I have no idea what could be causing this problem. It no longer makes any sense to me (other than there being something wrong with how Airtable is calculating the formula). Technically, there is nothing wrong with the formula because they both work when positioned at the top. Have you encountered this before?


siliceous
Forum|alt.badge.img+10
  • Author
  • Inspiring
  • April 23, 2026

I have decided on a workaround to this problem, so no worries about replying to this topic. It can be closed by the mods.