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

Working with Document Panes

Need to work with two different parts of a document at the same time? The answer is to rely on Word's ability to display ...

Discover More

Understanding the Clipboard

You can use the Windows Clipboard to move information around in Word. To make the most of the Clipboard, it is helpful to ...

Discover More

Specifying Index Section Dividers

When adding an index to your document, you can use one of the available field switches to specify how the index should be ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Understanding Names

Excel provides the ability to define names that refer to cells or ranges of cells. These can then be used in your formulas to ...

Discover More

Concatenating Ranges of Cells

Putting the contents of two cells together is easy. Putting together the contents of lots of cells is more involved, as ...

Discover More

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

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 eight minus 8?

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


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

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.