If_then expression

Hello!

I am having trouble with an expression. I have one spreadsheet that is referencing another. What I would like to happen, with the current spreadsheet that I’m in, is for the column [# of plants] to divide by the number in a referenced spreadsheet if the de-ref = “seed”.

So I have tried this expression:

IF(([Plant ID].[Tray Size] = “seed”) = ([_THISROW]/[Transplants Per Ft of Row]), [_THISROW])

But it does not check out. Appsheet expression assistant says

So the columns in my current spreadsheet are: [Plant ID] (which is a Ref to the [Plant ID] in the other spreadsheet, and [# of plants].

In the other spreadsheet I have [Plant ID], [Tray Size] and [Transplants Per Ft of Row].

What am I missing? If the [Tray Size] = “seed”, I want the [# of plants] to be divided by the number in the [Transplants Per Ft of Row] in the referenced spreadsheet. Otherwise, I want the number that shows up in the row to be unchanged (ie. not divided by another number).

Am I using the incorrect expression?
Many thanks!

0 1 90
1 REPLY 1

There are multiple issues here.

  1. You can’t use App Formula to calculate a new value for the column based on the original value of the column. Well, technically you can, but you shouldn’t do that for the vast majority of cases, like yours here. You should make a second column for the new calculated value.

  2. [_THISROW] refers to… this row. Not the value in the current column, that would be [_THIS]. But also, given point #1, you should no longer be using that, as you’ll be in a different column and you’ll just reference the original column instead.

  3. Your IF() syntax is incorrect. Your second equals sign should be a comma. There may be other errors beyond that. Make sure you review the IF() help article.

Top Labels in this Space