Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Checking for an Entry in a Cell.

Checking for an Entry in a Cell

Written by Allen Wyatt (last updated July 11, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021


6

There are times when it is helpful to know if a cell contains something—it doesn't really matter what it contains, just that it contains something. In these instances, there are two ways you can approach the problem.

The first solution is to simply use the LEN function to determine if there is a length to what is contained in a cell. For instance, let's say you wanted to check if there was a value in cell F1. You could use the following:

=IF(LEN(F1)>0,"Found something there","Nothing is there")

If there is nothing in cell F1, then the length will be equal to zero. If there is something in the cell, then the length will be greater than zero.

The second solution is a variation on the LEN approach. All you need to do is check to see if there is anything in the cell. This may sound odd, but it is easier when you see the formula. For example, the following will check to see if there is anything in cell B4:

=IF(B4<>"","Found something there","Nothing is there")

The test in this formula is True if there is anything in the cell. If the cell is empty, then the test fails.

Another solution you can use is the ISBLANK worksheet function. This function returns True if the target cell is blank, and False if it contains anything.

As an example, let's suppose you want to check if the user has entered something in cell D7. You can use the following to make the determination:

=IF(ISBLANK(D7),"Input values missing",D7)

In this case the cell containing this formula would contain the same value as in D7, provided something was there. If there is nothing in D7, then the cell contains the text "Input values missing."

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11439) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Checking for an Entry 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

Entering Tabs in a Table

When press the Tab key while entering info into a table, Word dutifully moves to the next table cell. If you don't want ...

Discover More

Generating Dynamic QR Codes

You can use Word to insert QR codes in your document. Things become just a bit trickier, however, if you want to add a QR ...

Discover More

Forcing a Worksheet to be Protected Again

Excel allows you to protect your worksheets so they can only be changed as you want to have happen. If you unprotect a ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More ExcelTips (ribbon)

Adding Spaces in Front of Capital Letters

Got some text that is "run together" and needs spaces inserted to improve readability? There are a variety of approaches ...

Discover More

Deleting Everything Up to a Character Sequence

Sometimes you have too much information in a cell and you need to "pare down" what is there to get to the info you really ...

Discover More

Splitting Sentences to Cells

If you have a lot of text in your workbook, at some point you might want to split out sentences into individual cells. ...

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 0 + 1?

2022-04-09 16:03:55

John Mann

Data Validation would be another method or checking to see if a cell contains data.

I had a situation where I needed for force any entry in to one cell before another cell could also have an entry, i.e. the 2nd cel could only have data entered if the another cell was non-blanck. I used data validation in that case. I used a formula based rule like this one "=C2<>0" (without the quotes), I also had the "Ignore Blanks" check box clear. This prevented data being entered into the cell where the data validation was applied unless there was already an entry in C2. Of course, data validation could also be applied to C2 to ensure that the correct type or range of data was entered there.


2020-08-19 21:52:03

Peter

I had a similar problem when I was entering data. I had opted to hide zeros, so I needed to show the cells with zero but not see the value. I did this with a conditional format that used the formula like =NOT(ISBLANK(A1)) that applied a soft pastel colour to the fill when true. Note the lack of $ signs in the formula. This seems to work fine with text, numbers, errors and formulas.


2020-08-19 09:44:07

Peter Atherton

Further to Mike's comment
ISBLANK returns false if aef contains a formula
e.g. if(a1=0,"","Value")


2020-08-18 12:34:41

JMJ

@Mike
Very useful remark! Thanks!


2020-07-11 12:50:24

Mike

These 3 methods are not exactly equal!

If the target cell contains just a single quote, the ISBLANK() method will detect it, but the LEN() method and the <>"" method will find nothing. Might be relevant if searching for the last used cell, as Find/Replace doesn't find it either.


2020-07-11 11:56:34

Steve D

Thank you for providing the variety of methods to detect cell content. I usually just jump to the Boolean option (<>), but it's a greater reminder to see the 2 functions, LEN and ISBLANK, as options. You're providing a great service to us in the Excel community! Cheers


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.