Article ID: 133049
Article Last Modified on 8/19/2003
[color1]positive# format;[color2]negative# format;[color3]zero# formatTo 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
[red]"after";[blue]"before";[green]"same"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.
A1: =IF(A5>DATEVALUE("2/28/95"),1,IF(A5<DATEVALUE("2/28/95"),-1,0))
[red]"after";[blue]"before";[green]"same"
number formats, creating custom
Additional query words: XL
Keywords: kbinfo KB133049