IF Funtion

brett4098

New Member
Joined
Jan 6, 2004
Messages
16
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
Joined
Aug 29, 2002
Messages
3,042
=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")
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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.
 
Learn Excel from Bill Jelen

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

Forum statistics

Threads
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.
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
Top