# IF Statement Logical Test

#### Bob_W

##### New Member
Apologies if this is a ridiculous question but please bear with me.

I recently inherited a workbook which was designed and built by a former colleague. Whilst working through the logic to ensure I understood what is happening in the various formulae and lookups, I've noticed a simple IF statement that I'm surprised works. It is:

=IF(A2>0,A2,"No")

Column A contains either:
- a 2-digit code formatted as Text and these codes are a combination of alpha & numeric characters, such as 1L, 2L, EF, IE, 5D, etc
- a 0 (zero)
- or the cell is [blank]

So my question is, why does the formula give True when the cell value is anything other than 0 or [blank]. Sure the logic test is numerical and therefore would only give true for a number value greater than 0. I would expect any kind of text string to give false. Or is there something obvious I am missing??

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### Fluff

##### MrExcel MVP, Moderator
In Excel a string is considered to be larger than any number.

#### Bob_W

##### New Member
In Excel a string is considered to be larger than any number.
Thanks, so it really is that simple! All these years I've been doing much more complicated formulae to achieve the same outcome! Every day's a school day as they say!

#### Fluff

##### MrExcel MVP, Moderator
Yup, it really is that simple.
Glad to help & thanks for the feedback.

Replies
11
Views
184
Replies
12
Views
209
Replies
6
Views
455
Replies
6
Views
529
Replies
3
Views
209

1,141,816
Messages
5,708,751
Members
421,588
Latest member
Wawie

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