# Excel cell format: color red if contains a formula instead of raw number?

**URL:** <https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303>\
**Category:** Factual Questions\
**Created:** [August 29, 2023, 5:39pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303 "2023-08-29T17:39:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [August 29, 2023, 5:39pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/1 "2023-08-29T17:39:47Z")

</div>

Someone else designed a spreadsheet for me to input data that they need; most rows are straightforward: July numbers come in and get typed into the July column for their row. But a couple of them are aggregates: I’ll get one part of the final number on Tuesday and a different component of it on Thursday, or whatever. So I’ll end up typing in the first number on Tuesday; the cell is now occupied, and to the eyeball looks like data is complete. But it isn’t. On Thursday I stick an = sign in front of Tuesday’s number then append a “+” and then Thursday’s number, so it’s a formula.

Any way I can make that cell be (for example) purple if it contains a raw number but yellow if it contains a formula adding two numbers together?

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [August 29, 2023, 5:43pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/2 "2023-08-29T17:43:19Z")

</div>

The FORMULATEXT() function returns the text of a formula if the cell contains a formula, or the #NA status if the cell contains a value. Test for that with ISNA and Robert is probably your mom’s brother.

> **[FORMULATEXT function - Microsoft Support](https://support.microsoft.com/en-au/office/formulatext-function-0a786771-54fd-4ae2-96ee-09cda35439c8)**
>
> Syntax: FORMULATEXT(reference)

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [August 29, 2023, 6:06pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/3 "2023-08-29T18:06:14Z")

</div>

I"ve gone to Home / Conditional Formatting. “Use a formula to define which cells to format”. Defined this as the formula:

ISNA(FormulaText(f:21))

where F21 is the test cell. Told it to make the cell cranberry pink under those circumstances.

Cell does not turn cranberry pink when cell contains =32+75 nor when cell contains raw number 113 instead.

If I change the formula to =ISNA(FormulaText(f:21)) it complains that it isn’t an appropriate/valid formula and won’t let me okay it.

What am I not doing that I’m supposed to do?

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [August 29, 2023, 6:10pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/4 "2023-08-29T18:10:33Z")

</div>

[![](https://global.discourse-cdn.com/straightdope/original/2X/d/d8cebb6845bd9faad8f3fb8757595efe67023cc1.jpeg) ](https://global.discourse-cdn.com/straightdope/original/2X/d/d8cebb6845bd9faad8f3fb8757595efe67023cc1.jpeg)

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [August 29, 2023, 6:12pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/5 "2023-08-29T18:12:56Z")

</div>

[![](https://global.discourse-cdn.com/straightdope/original/2X/c/cf61469f1054def25bb6c25ba85ce69216939415.jpeg) ](https://global.discourse-cdn.com/straightdope/original/2X/c/cf61469f1054def25bb6c25ba85ce69216939415.jpeg)

---

<div class="post-metadata">

**Author:** ![TroutMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troutman/32/6721_2.png) [@TroutMan](https://boards.straightdope.com/u/TroutMan)\
**Post date:** [August 29, 2023, 6:18pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/6 "2023-08-29T18:18:19Z")

</div>

ISFORMULA() is easier to use than FORMULATEXT(). And get rid of the colon between the column and row, and add an equal sign at the start.

`=ISFORMULA(A2)`

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [August 29, 2023, 6:27pm UTC](https://boards.straightdope.com/t/excel-cell-format-color-red-if-contains-a-formula-instead-of-raw-number/989303/7 "2023-08-29T18:27:48Z")

</div>

That worked, thanks
