A non-array formula to get the last number in Row 1 after "YES" in Row 2. In the first table , the answer is 2. In the second table, the answer is 0 as there is no value after "Yes"
Table 1
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]10
[/TD]
[TD]2
[/TD]
[TD]20
[/TD]
[TD]30
[/TD]
[TD]2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Yes
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Table 2
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]10
[/TD]
[TD]2
[/TD]
[TD]20
[/TD]
[TD]30
[/TD]
[TD]2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Yes
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Table 1
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]10
[/TD]
[TD]2
[/TD]
[TD]20
[/TD]
[TD]30
[/TD]
[TD]2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Yes
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Table 2
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]10
[/TD]
[TD]2
[/TD]
[TD]20
[/TD]
[TD]30
[/TD]
[TD]2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Yes
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Last edited: