Ask Your Question

# How to use Greater Than and Less Than to Prevent or Allow Equations

I'll do my best to explain what I mean.

=IF(H3>H4,H3-H4) This formula works as intended and lets me easily subtract the values in H3 and H4.

The issue is if I add, IF(H3<H4,H3-H4) I still need the values to subtract, but I don't want the values to go below 5 or into the negatives.

So I'm not sure how to set a minimum, I assume it is MIN(), but then I'm not certain on how to set up multiple functions together since my previous attempts to do so didn't work too well.

edit retag close merge delete

## Comments

2

If H3<=H4, it's known that H3-H4 is 0 or negative.

Your total function should be simply

=MAX(H3-H4;5)

( 2019-07-03 11:42:11 +0200 )edit

Hi @Mike IMHO why not put answers as Answer, it lets to mark them as correct, it's how Ask works, I think.

( 2019-07-03 22:33:29 +0200 )edit

@m.a.riosv: well - I didn't directly answered the asked question ("How to use Greater Than and Less Than") :-)

( 2019-07-03 22:35:06 +0200 )edit

I think it's not only a matter of solving directly the question, but to give the questioners a way to get it solved, or where to search for a solution. But show them how to do it, alternatives, not a solution as a gift.

( 2019-07-03 22:44:12 +0200 )edit

## 1 Answer

Sort by » oldest newest most voted

Thank you, @Mike Kaganski. Just using =MAX gives me what I need, instead of trying to use > or <.

more

## Comments

Please use the comments or edit your question.

( 2019-07-03 22:30:58 +0200 )edit

## Stats

Asked: 2019-07-03 11:21:01 +0200

Seen: 934 times

Last updated: Jul 03 '19