Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Checking for a Value in a Cell.

Checking for a Value in a Cell

by Allen Wyatt
(last updated November 30, 2015)

1

If you need to base a calculation on whether a cell has a number in it or not, you can use the ISNUMBER worksheet function. This function returns True if the target cell contains a numeric value or False if it contains anything else. For instance, if you want to do a calculation based on whether cell A3 contains a number, you could use the following:

=IF(ISNUMBER(A3),(A3*12)/52,"Enter number in cell A3")

This example results in the cell containing the result of (A3 * 12) / 52, but only if A3 contains a number. If it does not (for instance, it is blank or contains text), then the result contains the text "Enter number in cell A3."

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2113) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Checking for a Value in a Cell.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Strikethrough Shortcut Key

One common type of formatting is strikethrough, which is normally applied from the Font dialog box. There is no built-in ...

Discover More

Setting Your Default Document Directory

Word allows you to specify where it should start looking for your documents. This setting can come in handy if you store your ...

Discover More

Creating Charts in VBA

Most charts you create in Excel are based on information stored in a worksheet. You can also create charts based on ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

MORE EXCELTIPS (MENU)

Cell Movement After Enter

What happens when you press Enter in a cell depends on how you have Excel configured. Here's the way you can control the ...

Discover More

Changing Months in a Workbook

When you copy a worksheet and then need to make changes to information in that worksheet (such as changing month names), the ...

Discover More

How Many Rows and Columns Have I Selected?

Want a quick way to tell how may rows and columns you've selected? Here's what I do when I need to know that information.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one more than 2?

2012-06-30 07:48:46

Siddhartha

Hello Alen,

Further to my previous comment about the IF function working just as well as the ISNUMBER function.

I asked you if you could suggest any way in which I could stop the line chart from not nosediving to zero for a date in the future, I have indeed got an answer.
It certainly works:

Jon Peltier wrote on 22nd Jan 2011:

http://www.techrepublic.com/forum/questions/101-340530/excel-formula-to-not-graph-0s

The response was as follows:

Excel formula that won't graph zeros.
Change the 0 in the formula that is returned if there is no value to NA(). This puts #N/A into the cell. Line and XY charts in Excel do not plot a point if its X or Y value is #N/A.

If you change the 0 to "" to make it look like a blank, Excel considers this a piece of text, and still plots it as a zero.

I replaced the entire string argument "" with #N/A and it works brilliantly.
OK it shows #N/A for future values it does not know yet from source data, but once the source data is populated and the blue handlebar for the range is dragged well into the future, it just incorporates the populated value as a point on the line chart.

Thank you Jon Peltier of Techrepublic.com forum.

Regards to you both.
Siddhartha


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing
Share