# Problem with Nested IF

#### perfecttip

##### New Member
I have three columns of data.. A, B and C. A and B contain numerical values and C is blank. I need a formula for the column C so that
if A>B, then C = "more" (text)
if A<B, then C = "less" (text)
if A=B, then C remains blank.

Thank you.

### Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

#### Diablo II

##### Well-known Member
try

Code:
``=IF(A15>B15,"more","")``

#### perfecttip

##### New Member
That does not take care of all the conditions

#### Diablo II

##### Well-known Member
it will do what you asked and the only thing you asked. if A is grater then B the word more will be in C if A is less then B c will stay blank.

#### lenze

##### Legend
Hi and welcome to the board!!

Diablo's formula takes care of all the conditions you mentioned. What other conditions are there? Perhaps
Code:
``=IF(A2>B2,"More",IF(A2=B2,"","Less"))``
lenze

#### perfecttip

##### New Member
god knows whats wrong.. i edited the post thrice and still the entire thing does not appear.. let me try putting it in words....
if A is greater than B then C is "more", if A is lesser than B then C is "less", if A is equal to B then C is blank. Thank you.

Last edited:

#### perfecttip

##### New Member
yeah.. putting the entire matter in words worked..

#### lenze

##### Legend
So, see my above post!!
lenze
NOTE: A "<" will sometimes be interpreted as the beginning of an HTML statement. You need to place a space before and after any "<"

#### perfecttip

##### New Member
@lenze

thanks for your help.. but its not working
it returns "less" even when both the values of A and B are equal.

#### lenze

##### Legend
Re: @lenze

Are you sure?
Code:
``=IF(A2>B2,"More",IF(A2=B2,"","Less"))``
works fine for me

lenze

Replies
6
Views
209
Replies
4
Views
129
Replies
6
Views
328
Replies
2
Views
94
Replies
4
Views
175

1,195,953
Messages
6,012,515
Members
441,703
Latest member
clivelincoln

### 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.

### Which adblocker are you using?

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

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