Thank to @Suvrutt_Gurjar , I eventually found the original post of a duplicated one to which I responded earlier.
Here is my answer, in case that may help:
Hi @ABBA
I re-indented the expression so that it’s easier for me to read.
IF(
AND(
OR(
[Tank or Gauge Name]=“66018”,
[Tank or Gauge Name]=“Sales Tank #1”
),
[Previous Day].[Total-Inches]< [Total-Inches]
),
[Oil-Bbls]-[Previous Day].[Oil-Bbls],
"IF ([Tank or Gauge Name]=“11955”,[Previous Day].[Total-Inches]> [Total-Inches]) ,[Previous Day].[Oil-Bbls]-[Oil-Bbls]"
)
It seems correctly in terms of syntax, indeed, although the output is not matching between the result-true and result-false.
From my understanding:
You may need to change one of these.
Did you want to make this?
IF(
AND(
OR(
[Tank or Gauge Name]=“66018”,
[Tank or Gauge Name]=“Sales Tank #1”
),
[Previous Day].[Total-Inches]< [Total-Inches]
),
[Oil-Bbls]-[Previous Day].[Oil-Bbls],
IF (
[Tank or Gauge Name]=“11955”,
[Previous Day].[Total-Inches]> [Total-Inches] ,
[Previous Day].[Oil-Bbls]-[Oil-Bbls]
)
)
If so, you may want to use IFS() expression instead of nested IF() expressions.
Here is my suggestion:
IFS(
AND(
OR(
[Tank or Gauge Name]=“66018”,
[Tank or Gauge Name]=“Sales Tank #1”
),
[Previous Day].[Total-Inches]< [Total-Inches]
),
[Oil-Bbls]-[Previous Day].[Oil-Bbls],
[Tank or Gauge Name]=“11955”,
[Previous Day].[Total-Inches]> [Total-Inches] ,
TRUE,
[Previous Day].[Oil-Bbls]-[Oil-Bbls]
)
For reference:
IFS() - AppSheet Help