Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. 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: Highlighting Values in a Cell.

Highlighting Values in a Cell

by Allen Wyatt
(last updated December 1, 2021)


Trev has a table of sales forecasts by product that several users review and update. The forecasts are initially set with various formulas, but the users are allowed to override the formulas by entering a value into any cell that contains one of the formulas. If a user does this, it would be helpful for Trev to have Excel somehow highlight that cell.

There are a couple of approaches you can take. First, you could use conditional formatting to do the highlighting. Set the conditional formatting rule type to Format Only Cells that Contain, "Cell Value" "Not Equal To," and then enter the formula as the comparison. This will tell you when the value in the cell does not equal whatever the formula is, but a potential "gottcha" is if the person overrides the formula with the result of that formula. For instance, if the formula would have produced a result of "27" and the user types "27" into the cell.

Another possibility is to define a formula in a named constant and then use that named constant in a conditional format. Follow these steps:

  1. Display the Formulas tab of the ribbon.
  2. Click Define name in the Defined Names group. Excel displays the New Name dialog box. (See Figure 1.)
  3. Figure 1. The New Name dialog box.

  4. In the Name box, enter the name you want assigned to this formula. For this example, use CellHasNoFormula.
  5. Select whatever is in the Refers To box, at the bottom of the dialog box, and press Del. This gets rid of whatever Excel had there before.
  6. Enter the following formula in the Refers To box:
  8. Click OK.

Note that the ISFORMULA function (step 5) was introduced in Excel 2013. If you are using Excel 2007 or Excel 2010, then you should use the following formula in step 5, instead:


With the formula set up, you can define some conditional formats and use this named formula in the format. Simply set the conditional formatting rule type to Use a Formula to Determine which Cells to Format and enter the following formula in the condition:


The formula returns True or False, depending on whether there is a formula in the cell or not. If there is no formula, then True is returned and whatever format you specify is applied to the cell.

Another approach is to forgo the named constant approach and, instead, use a formula directly in your conditional formatting rule. Make sure you define the rul as Use a Formula to Determine which Cells to Format and enter the following formula in the condition if, for instance, you are conditionally formatting cell C1:


The formula returns True if there is no formula in the cell, so the conditional format is applied.

If you are using Excel 2007 or Excel 2010, you can put together your own ISFORMULA function using a macro, like this:

Function IsFormula(Check_Cell As Range) As Boolean
    IsFormula = Check_Cell.HasFormula
End Function

You can then use your own IsFormula in the conditional formatting rule, as already discussed.

The only downside of using any of these formulas to determine if a formula is in the cell is that it cannot determine if the formula in the cell has been replaced with a different formula. This applies to both the macro approach and the defined formula approach.

A totally different approach is to rethink your worksheet a bit. You can separate cells for user input from those that use the formulas. The formula could use an IF function to see if the user entered something in the user input cell. If not, your formula would be used to determine a value; if so, then the user's input is used in preference to your formula. This approach allows you to keep the formulas you need, without them being overwritten by the user. This results in greater integrity of the formulas and the worksheet results.



If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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


Changing Paragraph Order

Want a quick way to rearrange entire paragraphs of your document? You can easily do it by using the technique described here.

Discover More

Splitting Information into Rows

Got too much information in a single cell? Here's how you can use a macro to pull apart that information and put it into ...

Discover More

Assigning a Macro to a Button in Your Text

One way you can access macros is through the use of a button, added directly into the text of your document. This is done ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Using Strikethrough Formatting

Need a line through the middle of your text? Use strikethrough formatting, which is easy to apply using the Format Cells ...

Discover More

Changing Font Sizes

Want to change the size of the font within a worksheet? Excel allows you to choose from a list of sizes, as well as ...

Discover More

Number Formatting Shortcuts

Keyboard shortcuts can save time and make developing a workbook much easier. Here's how to apply the most common of ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


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 9 + 5?

2021-07-04 01:04:31


Sorry, forgot something.

@Andy R, and anyone else who wondered, your point 1 about the "48" in Allen's formula:

Yes, as used, the 48 IS a constant. GET.CELL has MANY possible uses and one enters a value such as 48 or the 5 Bigger Don mentions to let the function know which use you wish to make of it. But it is able to take a formula too, one whose result is a numeric value that is one of the values it takes. Additionally, it can take an array of constants so =GET.CELL( {5,48 }, A1) returns both results in a SPILL array. Or one could use GET.CELL( M19, A1) with the value 5 in cell M19. But one cannot use a bare array constant in such a use, that of placing the array constant in cell M19. One must use ={5,48} rather than just the bare {5,48} to use an array constant as the source for M19's value. But... like many older functions, it will just return the first element's value unless you can coerce it back to using the full array for returns. This is because of an interesting fact: even the Excel functions that return a single result (the "first" or the "upper left") actually have the full array calculated and a available. One can force ("coerce") that to be carried forward in a formula IF one wraps it with a function that will do so. Or use a functionality that will do so. And if one's further formula can return a SPILL result, you get all of the returns from the arrays.

So: =GET.CELL(M19#, A1) will take an array in M19 and use all its returns (because we added the "#" (or could have added the rest of a desired range if we'd've preferred, but why when the "#" makes it the dynamic range?) and provide all its results, not just the "first" one. In this case, the use of SPILL functionality forced the return of all of them. Usually one has to find a function that doesn't transform things to much so restoring to the desired output is easy enough, or not actually needed.In other words, GET.CELL must have that parameter, but clearly uses Excel's standard mechanisms for specifying a parameter. (By the way, the ONLY ONLY ONLY thing LAMBDA adds to Excel is giving us access to using Excel's standard mechanisms for specifying a parameter. We have always been able to use Named Ranges to CREATE USER FUNCTIONS, ever since the old macro language and Named Ranges existed, and so has been Turing-complete for at least 30 years. But either we had to limit the entries a user could use for input (frustrating to Excel users), or use the foreign-feeling (to Excel users) method of letting them enter whatever they liked but having to use the mechanism by which they specify the parameter but then an usually put them in any order (still feeling foreign to them), or make the set-up logic so incredibly obnoxious it wasn't worth doing. Not to mention the toughness in using them in new spreadsheets. So I'm not sneering at LAMBDA not being the gift of the gods, but that HUGE thing of accepting standard input mechanisms is really all it adds. Still, it's huge, and so is the fact that the Excel4 macro commands can do it too.

Also for Andy R, there is a formula that directly answers whether a cell contains a formula. I mentioned it below, but explicitly, it ISFORMULA.

As to specifying "current cell", often in a formula one can just leave the reference parameter blank and Excel will proceed as if it has the current cell's address explicitly specified. Add to the formula a volatile expression that does not taint the actual intended result and one can have a "poor man's" way of specifying a formula act upon the current cell that works almost completely automatically. It forces recalc so that Excel does so and updates the value being produced. Without the volatile portion, one would have to press F9 to get that. When I say "poor man's version" I mean vs. using VBA. Using VBA, ANY change desired can be used to trigger the update of value. Using the poor man's version, only cell value changes force updating. Change just a format and one still has to force recalc by using something like F2-Edit and pressing of ENTER. The VBA use would not have to do that. Not a problem in many cases, but consider if one were trying to change a cell color based upon a cell color change elsewhere. (I know that sounds arcane, but cell color enthusiasts buy into cell color massively and seem to hinge everything upon it with a great resistance to combining available techniques... if they will only use a hammer, everything must look like a nail, eh? Even a drinking glass...)

2021-07-04 00:24:10


Now that seven years have passed, we have a couple new things so one can choose not to use GET.CELL if one likes.

This is NOT to disparage the Excel4 Macro commands that can work even today. (Don't misunderstand that either: not only is there the fact that most are meant to PERFORM things as they were macro COMMANDS, not formulas, and so have no real mechanism for working in out-of-the-box Excel, but there is also the fact that one can enable Excel4 macros and macro sheets in regular Excel in which case every one of them I've tried (not that many, but still...) actually does work.) I've used them for their entire existence and GET.CELL was the only way to get a formula out of a formula-bearing cell for most of that time. Several others are handy as well, though a few others that would be have nice Excel functions now so...

Some are actually better. And some must use a mechanism for getting a result that Excel simply no longer has since they produce a big, fat nothing. Cell width is one that still works better. Today's CELL("width",cell) produces an integer while GET.CELL produces a two decimal value.

Interesting point, one that speaks to ONE reason some won't use them, is that, when saving the spreadsheet, Excel tells you it must be saved as a macro spreadsheet (.xlsm). In fact, not only can you just save it as a .xlsx file, but also, that does not strip out the "macros" because you don't actually have any macros to strip out. Open the file and all is still there in the Named Ranges and all still functions nicely. And it doesn't warn you after the first time saving.

Of course, if you enable Excel4 macros and macro sheets, you do have to save as a macro spreadsheet.

But one can substitute FORMULATEXT for GET.CELL now. No extra step taken with care about addressing.

Also, entries like "=27" type entries keep one from using just a bare ISFORMULA. Using FORMULATEXT, one can use =FORMULATEXT(cell)=whatever_your_formula_is (entering the formula text as a string in the formula) which tests that the formula (if there IS one) in the cell matches the formula used by the spreadsheet's writer. (That assumes the user is just "using" and not actively trying to break things.) But then it has to be a bit more complicated to handle the user doing just what he's supposed to be doing, entering simple values, which will cause an error in the formula above.

So, wrap the function with IFERROR:


If a non-formula was entered, the error will be caught by IFFERROR and "" returned (and by definition, "" cannot be what the formula was... unless someone enters ="". (Sigh...) So, more complicated:


which covers you unless... your own formula was entirely ="" in which case you need... NO. Like so many things in Excel, and Xeno-like paradoxes, one has to rise above it, climb out of the rabbit-hole and say "ENOUGH"... "Today, my jurisdiction ends here." (Big fan of Silverado.)

Or just use Allen's UDF. It really depends, in my opinion (Honest or otherwise... sheesh, how redundant is "IMHO"? Does it really have to be larded up like that?), it really depends upon whether you control the environment (users must bend to you will and concerns, probably are all in your chain of command, or at least all in your organization), or do you have little to no control? In the former case, the USF rules, unquestionably. In the latter case, doing what you can formula-wise may be your only recourse as UDF's require a macro-enabled workbook be distributed and used and that isn't always possible.

Long live LAMBDA and anything related that comes after it. (You know, in a year or two when we HOI POLOI finally get it.)

2014-10-22 09:47:46

Bigger Don


I had never seen Get.Cell before, nor had I seen using "rc" for current cell in an Indirect().

A little research shows Get.Cell is a holdover from Excel4 Macros. There are references on-line that will tell you what other constants give different results. Just search for "Get.Cell".

To get the value of the cell use "5". Warning on that is it returns "0" when the cell is blank, similar to what happens with VLOOKUP().

Oddly, "Get.Cell" cannot be used in a cell formula nor can I find a way to use it in VBA code. The only place I can see an ability to use it is in a Name. It looks like that is why Allen put it into the Name before using it in a Conditional Format formula.

As to using the "rc" in the Indirect(), I did a little experimentation with that.
* "rc" does return the current cell
* Putting a number after "r" or "c" uses the absolute row or column number. So if you wanted to look in Column A of the same row it would read "rc1".
* Putting that number in square brackets, i.e. "[]", gives the relative address. If you wanted to compare the value of the Column A in the current row with Column A of the previous row then the formula would be "=Indirect("rc1",False)=Indirect("r[-1]c1",False)" without the quotes. (I use this type of comparison to set the font color equal to the background color when there is redundant information. It makes spreadsheets much more readable as reports.)

2014-10-20 06:27:00


Excel will also treat a cell entry of "=27" (without the parentheses) as a formula because of the equals sign.

2014-10-19 23:49:28

Andy R

Thanks for the tip. I have been scratching my head to understand exactly how this works as I think it could have many uses.


Can you confirm:
1 - How you know that "48" means a Constant?

2 - I assume since you chose the "not" path, there isn't a variable that tells you the value in the cell is a formula?

This is the first time I've seen "rc" as part of an Indirect. It got me thinking about its use irrespective of the use above.

3 - I assume this essentially means "current cell"?

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

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.