"Cortez" wrote:
I'd like to build a custom number format where the text
format section contains an if statement. Here is an
example to explain what I'd like to replicate:
#,##0_);(#,##0);;if="null" then ""
The number format would leave treat positive and negative
values normally, would display a blank cell if the value
is zero, and would display a blank cell if the cell value
is text "null", otherwise if the cell value is any other
text it would display that text.
1,-2,0,null,X would become 1,-2,,,X
You do not mention the version of Excel that you use.
AFAIK, XL2003 does not have any custom formats or format subtypes for Text.
I am pretty sure the same can be said for XL2007 and later.
Also, you cannot use Conditional Formatting to accomplish this in XL2003.
But I believe CF is more robust in XL2010, perhaps XL2007 as well.
Nonetheless, I don't know if it is robust enough to accomplish this kind of
"formatting". I doubt it.
Usually, you must accomplish this in your formula. For example:
=IF(ISNUMBER(A1),A1,IF(A1="null","",A1))