Nested If expression

Hello,

I am doing an inspection form, I have an initial column, does this exist? hitting no hides the below columns and yes shows them.
If you select yes you must enter information for the below columns.

I have a result column at the end. I am trying to write, If the exist column is no then it does not matter what is in the following column but hitting yes should require the columns to abide by a criteria.

The result should display either a pass or fail

Here is what I have but It will clearly not work as selecting no in the exist column means it fails. I think I need a nested if statement to ask does it exist? if yes then do these pass? if they fail then fail, If it does not exist then pass. I am just unsure how to write this.

IF(AND(
[Fire Suppresion System?] = Yes,
[Fire Suppresion Date] > Today() - 182,
[Fire Suppresion Pressure] = Good,
[Fire Suppresion Visual Condition] = Good),
Pass,
Fail
)

Maybe something like:

IFS(
		[Fire Suppresion Visual Condition] = Good), Pass,
		[Fire Suppresion Pressure] = Good, Pass,
		[Fire Suppresion Date] > Today() - 182, Pass,
		[Fire Suppresion System?] = Yes, Pass,
		TRUE, Fail
)

with the first conditions being the last to check steps. You might want to switch the position as suitable for your case to avoid IFS to return Pass too early.

3 Likes

Thanks @Heru,

I made some small modifications and it works perfectly.

Just a side question how does everyone who post here have their expressions display with indents?
Can I get my Expression assistant to display like this as its easier to read.

1 Like

I am using a text editor, and just just copy paste after typing 4 back-ticked (````) and close it with the same back-ticked.

2 Likes