I think I need an IF statement

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
 
D

Don Guillett

If they are the same then it doesn't matter which is used.

=MAX(F23-D23,K23-I23)
 
G

Guy Story

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top