A recurring Excel problem I have is formulas such as INDEX(array,row,column)
that return 0 when there\'s no result, rather than returning blank.
What is
Just append an empty string to the end. It forces Excel to see it for what it is.
For example:
=IFERROR(1/1/INDEX(A,B,C) & "","")
None of the above worked for me today, so I tried putting the 0 in quotes, as shown in the example below.
Example: =IF(INDEX(a,b,c)="0","", INDEX(a,b,c))
I figured it out, by concatenating an EMPTY
string.
INDEX(tt_Attributes,MATCH([RowID],tt_Attributes[RowID],0),COLUMN(tt_Attributes[Long Description]) ) & ""
I am not sure it works with all type of data but the only solution I found for the moment is to test if index returns blank:
=IF(ISBLANK(INDEX(a,b,c)),"",INDEX(a,b,c))
The formula
=IF(INDEX(a,b,c),INDEX(a,b,c),"")
does not work with text
If you’re willing to cause all zeroes in the worksheet to disappear, go into “Excel Options”, “Advanced” page, “Display options for this worksheet” section, and clear the “Show a zero in cells that have a zero value” checkbox. (This is the navigation for Excel 2007; YMMV.)
Regarding your answer (2), you can save a couple of keystrokes by typing 0;-0;
–– as far as I can tell, that’s equivalent to 0;-0;;@
. Conversely, if you want to be a little more general, you can use the format General;-General;
. No, that doesn’t automagically handle dates, but, as Barry points out, if you’re expecting a date value, you can use a format like d-mmm-yyyy;;
.
There is a very simple answer to this messy problem--the SUBSTITUTE function. In your example above:
=IF((1/1/INDEX(A,B,C))<>"",(1/1/INDEX(A,B,C)),"")
Can be rewritten as follows:
=SUBSTITUTE((1/1/INDEX(A,B,C), " ", "")