How to create an IF formula to do greater than, less than, OR equal to

JerryMason

New Member
Joined
Jun 2, 2022
Messages
7
Office Version
  1. 365
Silly question maybe but I can't find the answet to it anywhere, or I'm not asking it correctly.

I would like to compare two cells A and B and with one formula in cell C and produce one of three states instead of the normal two: true or false. e.g.
if(A2>B2, "Greater Than", "Less Than")

I've done greater than or equal to many times, but for the first time in my life I've found the need to actually differentiate for that third option by itself if present. "Greater than or equal to" conflates the two and separates less than. And vice versa.

This is obviously wrong, but how can I rewrite this:
if((A2>B2, "Greater Than", "Less Than")if(A2=B2, "Equal To"))
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Welcome to the MrExcel forum!

Try:

Excel Formula:
=IF(A2>B2,"Greater than",IF(A2<B2,"Less Than","Equal to"))
 
Upvote 0

Forum statistics

Threads
1,215,048
Messages
6,122,862
Members
449,097
Latest member
dbomb1414

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