# Urgent - MS Excel Question

**URL:** <https://boards.straightdope.com/t/urgent-ms-excel-question/179575>\
**Category:** Factual Questions\
**Created:** [June 4, 2003, 12:53pm UTC](https://boards.straightdope.com/t/urgent-ms-excel-question/179575 "2003-06-04T12:53:49Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Tarantula](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tarantula](https://boards.straightdope.com/u/Tarantula)\
**Post date:** [June 5, 2003, 10:37am UTC](https://boards.straightdope.com/t/urgent-ms-excel-question/179575/21 "2003-06-05T10:37:43Z")

</div>

Trying to use the change the color of the text if the cell = #DIV!0… I presume that I am missing something… is there a conditional format that would give the same result as the “iserror” formula ?

---

<div class="post-metadata">

**Author:** ![tastycorn](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tastycorn](https://boards.straightdope.com/u/tastycorn)\
**Post date:** [June 5, 2003, 10:48am UTC](https://boards.straightdope.com/t/urgent-ms-excel-question/179575/22 "2003-06-05T10:48:40Z")

</div>

Hmmm, actually I thought I remembered it could be done with a custom number format mask, changing the color of the text for a value of zero (since Dootsies first suggestion does indeed work).

However, upon experimenting, I can’t get it to work. Interesting.

**kabbes** , how do you do it? I’m stumped.

---

<div class="post-metadata">

**Author:** ![Tarantula](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tarantula](https://boards.straightdope.com/u/Tarantula)\
**Post date:** [June 5, 2003, 11:29am UTC](https://boards.straightdope.com/t/urgent-ms-excel-question/179575/23 "2003-06-05T11:29:00Z")

</div>

The problem is that it’s not a zero value - it’s a “#DIV!0” value…

---

<div class="post-metadata">

**Author:** ![kabbes](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@kabbes](https://boards.straightdope.com/u/kabbes)\
**Post date:** [June 5, 2003, 12:27pm UTC](https://boards.straightdope.com/t/urgent-ms-excel-question/179575/24 "2003-06-05T12:27:11Z")

</div>

I thought you could do it with some clever custom number masking too, but damned if I can make it work now. I might have another go at it later.

Just have to stick with the proper (i.e. IF()) solution after all 🙂

Here’s another thought too: a custom function. Define the function DIV(a,b) in VBA:

```auto

Function Div(a,b)
     If b = 0 then Div = 0 else Div = a/b
end function

```

Then instead of using a/b you can use Div(a,b)

i.e. to divide cell A1 by A2 set cell A3 as “=Div(A1,A2)”

pan

---

<div class="post-metadata">

**Author:** ![Tarantula](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tarantula](https://boards.straightdope.com/u/Tarantula)\
**Post date:** [June 5, 2003, 12:33pm UTC](https://boards.straightdope.com/t/urgent-ms-excel-question/179575/25 "2003-06-05T12:33:28Z")

</div>

Nice one Kabbes - seems like there are plenty of solutions to this… I think dootsie’s one was quickest and easiest…

Thanks all for the help…

:Happy Monkey:

[Previous page](https://boards.straightdope.com/t/urgent-ms-excel-question/179575.md?page=1)
