Can someone please help me with a formula to do the following? I can't find any previous solutions.
If a value from column A, features in any value in column C as the 3rd and 4th value, return the value from column B corresponding to the value in column A. Results being returned in column D.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[/TR]
[TR]
[TD]AB[/TD]
[TD]Apples[/TD]
[TD]12XY9009[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XY[/TD]
[TD]Bananas[/TD]
[TD]35AB1221[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]DX[/TD]
[TD]Pears[/TD]
[TD]96AB9875[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]FR[/TD]
[TD]Oranges[/TD]
[TD]89DX6854[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
If a value from column A, features in any value in column C as the 3rd and 4th value, return the value from column B corresponding to the value in column A. Results being returned in column D.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[/TR]
[TR]
[TD]AB[/TD]
[TD]Apples[/TD]
[TD]12XY9009[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XY[/TD]
[TD]Bananas[/TD]
[TD]35AB1221[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]DX[/TD]
[TD]Pears[/TD]
[TD]96AB9875[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]FR[/TD]
[TD]Oranges[/TD]
[TD]89DX6854[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]