Put this formula in cell B1 then enter various temperatures in A1

=IF(A1<=25,25,IF(A1>100,0,(25-(5/75)*(A1-25))))

No guarantees, check various values before committing to the formula.

The formula delivers 25 for all temperatures less than or equal to 25 deg C. It does derating for temperatures above 25 degrees out to 100 degrees and returns 0 for temperature above 100 degrees.