If Greater, Equal or Less Than Formula

RYANE

New Member
Joined
Nov 3, 2015
Messages
11
Hi,

I am trying to get a cell to show me the following:

If cell AI2 is greater than O2 say "OVER" in cell A2
If cell AI2 is less than O2 say "ACTIVE" in cell A2
Or, if cell AI2 is equal to O2 say "CLOSED" in cell A2

I am currently using the formula =IF(AI2>=O2,"OVER",IF(AI2<=O2,"ACTIVE,IF(AI2=O2,"CLOSED")))

It would seem that the formula for two cells equaling the same value is not working.

Any help would be appreciated. Thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
That is because you are using Greater Than or equal to (>=) instead of just Greater Than (>).
Same thing with less than.

Try:
Code:
[COLOR=#333333]=IF(AI2>O2,"OVER",IF(AI2 < O2,"ACTIVE","CLOSED"))[/COLOR]
Notice how I just use the second argument of the second IF for Closed instead of nesting another IF.
If it is not greater than or less than, the only choice left is equal to.
 
Last edited:
Upvote 0
AI2 being equal to O2 is already included in the first IF criteria AI2>=O2.
That says if AI2 is greater than OR 'EQUAL TO' O2, then return OVER

You probably want to change both of those comparisons to remove the = part.
1st if tests >, 2nd if tests <

And you don't actually need the 3rd IF.
If neither > or < is true, then it MUST be =.
 
Upvote 0
Thank you so much! I can't believe it was something that simple. "The more you know!"


That is because you are using Greater Than or equal to (>=) instead of just Greater Than (>).
Same thing with less than.

Try:
Code:
[COLOR=#333333]=IF(AI2>O2,"OVER",IF(AI2 < O2,"ACTIVE","CLOSED"))[/COLOR]
Notice how I just use the second argument of the second IF for Closed instead of nesting another IF.
If it is not greater than or less than, the only choice left is equal to.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top