# 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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

#### 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
9
Views
156
Replies
1
Views
97
Replies
0
Views
50
Replies
4
Views
104
Replies
2
Views
35

1,186,168
Messages
5,956,341
Members
438,247
Latest member
UZev

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