# IF Funtion

#### brett4098

##### New Member
How would I formulate "if (cell) has a number, then do this.
IF(C1=any number, then do this, else do this)?

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

#### Todd Bardoni

##### Well-known Member
=IF(C1, "It's a number", "It's not a number")

OR, if the cell can also contain TEXT other than just being blank, then:

=IF(ISNUMBER(C1), "It's a number", "It's not a number")

##### MrExcel MVP
tbardoni said:
=IF(C1, "It's a number", "It's not a number")

Todd,

The idiom "IF(C1" holds when what we deal with is a number (either zero or non-zero).

If the 'numberness' is the issue, we need either...

=IF(ISNUMBER(C1), X, Y)

or

=IF(N(C1), X, Y)

The last one is less generic, that is, it only distinguishes between text and number on the one hand and zero and non-zero on the other hand.

#### Todd Bardoni

##### Well-known Member
Yep, I realized that after my original post and made the edit.

Thanks!

Replies
4
Views
451
Replies
7
Views
134
Replies
2
Views
77
Replies
2
Views
148
Replies
7
Views
56

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

1,151,565
Messages
5,765,133
Members
425,263
Latest member
alcat

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