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

Adjusting Column Widths on Joined Tables

Each table in a document can have different numbers of columns and different widths for columns. If you want to join two ...

Discover More

Changing between English Variants

What is the easiest way to switch between English spelling variants in a document? This tip examines a couple of ways you ...

Discover More

Working with Imperial Linear Distances

Excel works with decimal values very easily. It is more difficult for the program to work with non-decimal values, such ...

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)

Deleting All Names but a Few

Want to get rid of most of the names defined in your workbook? You can either delete them one by one or use the handy ...

Discover More

Finding Wayward Links

Combining workbooks that have cross-links to each other can offer some special challenges. This tip examines how you can ...

Discover More

Forcing Editing to Be Done in a Cell

Excel allows you to edit your cell contents in two places. What if you want to limit where editing occurs, so it can only ...

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 6 - 0?

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.