The information in this article applies to:
SUMMARYIn Microsoft Excel, a function cannot automatically format text based on the type of value it returns. However, you can create a custom number format that will return different colored text, based on whether your function returns a positive, negative, or zero value. MORE INFORMATIONIn Microsoft Excel, number formats are based on the following:
To have a function return up to three different types of text value, each
with a different color, have the function return either a positive number,
a negative number, or a zero value, and format the custom number format
such that it displays text based on those values. For example, the
following custom number format
will display the word "after" in red if the function returns a positive
number, the word "before" in blue if the function returns a negative value,
and the word "same" in green if the function returns 0.
Example
REFERENCES
"User's Guide," version 5.0, Chapter 12, "Formatting a Worksheet" number formats, creating custom Additional query words:
Keywords : xlformula |
Last Reviewed: September 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |