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

Written by Allen Wyatt (last updated April 15, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


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

Handling Long Lines in Address Labels

When you print address labels, you only have a limited amount of horizontal space for each line of the label. If your ...

Discover More

Deleting All Tab Stops

Tab stops can be helpful when you want to align text within a paragraph. However, you might also want an easy way to get ...

Discover More

Keeping Tables on One Page

Need to make sure that your smaller tables stay on a single page? Here's a handy trick you can use to enforce this rule.

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)

Counting Words

Do you need to know how many words are in a range of cells? Excel provides no intrinsic way to count the words, but you ...

Discover More

Combining Columns

Need to concatenate the contents in a number of columns so that it appears in a single column? Excel has no intrinsic way ...

Discover More

Sequentially Inputting Information

When entering data in a worksheet, you may only want to add information to the cells in a particular range. You can ...

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}] (all 7 characters, in the sequence shown) 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 one less than 9?

2019-09-17 20:20:01

Jay Bingham

This is good advice as far as it goes, however, suppose that you have a formula that can produce either a number or a blank cell and you have a formula in a second cell that references the first cell but it will produce an error if the formula in the first cell does not produce a number. Neither the ISNUMBER nor the ISBLANK function are of any use in this case, because contents of the first cell is neither a number or a blank.
I have found that the MAX and the MIN functions can be used to determine if the referenced cell actually contains a number.
For example if cell C4 contains this formula =IF(SUM(D24:D34),SUM(D24:D34),"") and in another cell, lets say C22, you want to determine if cell C4 resolves to a number rather than a blank so that the formula in C22 will not produce an error if C4 resolves to a blank then the formula in C22 can use the MAX function to make that determination, e.g. =IF(AND(MAX(C4)>0,C13>0),C4/C13,"").
There may be other ways to determine this but I stopped looking when I found that MAX and MIN would do the trick.


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.