Here is the formula I used which contains combination of IF and INDEX
=IF(STREAM!E5:E54>0,INDEX(STREAM!F5:F54,P1,1),INDEX(STREAM!E5:E54,P1,1))
In this, I have faced the problem that only one condition returns output, other returns 0.
If STREAM!E5:E54 is true then it returns the value of INDEX(STREAM!E5:E54,P1,1)
If STREAM!E5:E54 is false then it returns the value 0.
=IF(STREAM!E5:E54>0,INDEX(STREAM!F5:F54,P1,1),INDEX(STREAM!E5:E54,P1,1))
In this, I have faced the problem that only one condition returns output, other returns 0.
If STREAM!E5:E54 is true then it returns the value of INDEX(STREAM!E5:E54,P1,1)
If STREAM!E5:E54 is false then it returns the value 0.