I think I need an IF statement

  • Thread starter Thread starter Shhhh
  • Start date Start date
S

Shhhh

Hello all,

what I need to do is have a formula where if (F23-D23) is greater than
(K23-I23), use (F23-D23),...
IF (F23-D23) is less than (K23-I23), Use (K23-I23)... If they are
equal use (F23-D23)

I hope I explained what I'm looking for properly..

Any and all help appreciated,
Thank you,
Shhhh
 
Shhhh said:
Hello all,

what I need to do is have a formula where if (F23-D23) is greater than
(K23-I23), use (F23-D23),...
IF (F23-D23) is less than (K23-I23), Use (K23-I23)... If they are
equal use (F23-D23)

I hope I explained what I'm looking for properly..

Any and all help appreciated,
Thank you,
Shhhh

Don's Max statement response is much simpler. I was not aware of the
MAX function. It is also not order specific like the IF statement is.
If both cells are the same, who cares.

I posted the IF statement formula so show the difference.

Check for K23-I23 and F23-D23 to be equal first. Then nest a second IF
statement in the ELSE section to do the greater/less than logic. Do you
have cells that get the results of K23-I23 and F23-D23? It makes for a
cleaner formula from an aesthetics point but is not required. The raw
formula I threw together is

=IF(AND((K23-I23)=(F23-D23)),(F23-D23),IF(((F23-D23))>(K23-I23),(F23-D23),(K23-I23)))

If you have K23-I23 and F23-D23 results being calculated already, then
replace K23-I23 with that cell and F23-D23 with that cell.


Guy
 
Back
Top