cant get the is/ else etc correct

I have a fan control for an engine room, which turns on when the engine room temp is 25F higher than the intake temp, and turns of only when the temp difference is 12 F

so I have Tempout . = outside temp Tempin = temp inside DIFF. = difference DIFFON . = temp difference when fan comes on DIFOFF. = temp difference when fan goes of

I am using if (DIFFON > DIFF && DIFFOFF > DIFF) { turn fan on} else if (DIFFOFF > DIFF) {keep fan on} else {turn fan off}

if seems to ignore the DIFFOFF > DIFF statement

whenre am I not doing it correct

TIA

Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]

This

 if (DIFFON > DIFF  && DIFFOFF > DIFF)

Reads in plain English as:

If the difference is less than 25 and the difference is less than 12 then....

==> if it’s less than 12 it’s surely less than 25 anyway...

And So it makes sense it Never goes into the if (DIFFOFF > DIFF) because it would have been captured in the first if

dutch-barge:
I am using

if (DIFFON > DIFF  && DIFFOFF > DIFF) 

{ turn fan on}
else  if (DIFFOFF > DIFF)
      {keep fan on}
else
      {turn fan off}

Why do you need anything more complex than this

if (diff > diffOn) {
   // turn fan on
}
if (diff < diffOff) {
  // turn fan off
}

…R