Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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.
by Allen Wyatt
(last updated October 17, 2015)
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, and 2013. You can find a version of this tip for the older menu interface of Excel here: Checking for an Entry in a Cell.
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!
Excel makes it easy to transpose your data so that rows become columns and columns rows. It doesn't have a built-in ...Discover More
Paste information in a worksheet, and you may end up with Excel placing it into lots of different cells. If you want it ...Discover More
If you distribute a workbook that is used by others for data entry, you may want a way to make sure they fill in certain ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.