I need to use the if statement with set of cells, say C4:C33, and the return for TRUE condition is the same as cell value, while for false condition the return value is zero. The following is an explanation:

=MIN(IF(C4:C33<C40,C4:C33,0))

However, this form is giving invalid value because I am using the same set as a True result.

Thanks for your reply, What I exactly want, is that, if the value of specifc cell in column C is lower than the fixed value (placed in cell C40) the the output from If-statement is the same value of specific C-cell, else, the output value is zero. C40 is only used for condition/comparesion and not used as an output neither in True nor in false conditions.

What I need is to use a set of cells (C4:C22) instead of only one cell C4.

The use of min function is to serve other purpose. The overall picture is that, I have a set of numbers which represent a test scores between 0 and 50. What I want to find is the highest score below the succeed point which is 25. For example, If I have the scores: 10,20,23,30,40,49; the value I need to find should be 23 in this example.