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

Preserving Style Formatting when Combining Documents

Insert one document into another and you may not get the results you expect. Here's why, along with what you can do about it.

Discover More

Creating a Plus/Minus Button

Want a quick way to convert positive values to negative and vice versa? You can create your own plus/minus button by using a ...

Discover More

Calculating Fractions of Years

When working with dates and the relationship between dates, Excel provides a variety of worksheet functions that may prove ...

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)

Editing Individual Cells

Need to edit the data within a cell? There are any number of ways you can perform the edit; this tip documents them all.

Discover More

Searching Comments

Need to find that misplaced comment in your worksheet? It's easy to do using the Find and Replace capabilities of Excel.

Discover More

Errors when Copying References to External Cells

If you copy a cell that contains a reference to external data, do you get an error? It could be due to the complexity of 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. Maximum image size is 6Mpixels. 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 7 - 0?

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.