# Thread: Help with Formula to Remove Zeros from Cells

1. Registered User
Join Date
Sep 2008
Posts
151

## Unanswered: Help with Formula to Remove Zeros from Cells

Hello,

Wondering if one of you experts out there can help me with this formula.

I am trying to create a formula to remove “0” in a linked cell. I want to show blank cells, no zeros.

Here is my attempt at the formula:

=IF (E160=0,””,(NETD(C106,D106))

I am using Excel 2010.

Thank you. :-)

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
are there actually zeros in that / those columns, or is there a format that is representing "" as 0
if its a format then you will need to change the format itself

3. Registered User
Join Date
Sep 2008
Posts
151
No, there is actually "0" in the cell.

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
is this for display purposes of use elsewhere
ie do you actually want to set the value to be "" or just see the value as ""?

if the latter than using a cusotm format may be the smartest approach
eg:-
Code:
`#,##0;[Red]-#,##0;""`
its the third term that says effectively if 0 then display as ""

if you need to physically remove the 0 then you'd probably need to write some VBA code and run it as a macro
My Excel is very rusty
but you'd need to work out what the range of cells you were going to examine
then for each cell check to see if its a 0 value and if so set that cell to ""

5. Registered User
Join Date
Sep 2008
Posts
151
No, it is not a display or format issue. I did it before with a formula, but I don’t think I am structuring my formula correctly. :-(

6. Registered User
Join Date
Sep 2008
Location
London, UK
Posts
511
If the 0 in E160 is a string type rather than a double (ie. "0" rather than 0) then your formula won't pick it up. To cater for both you could use something like the below.
Code:
```=IF(OR(E160={0,"0"}),"",NETD(C106,D106))

or

=IF(E160&""="0","",NETD(C106,D106))```

7. Registered User
Join Date
Sep 2008
Posts
151
Hi Colin,

Thank you so much for your response. I tried both of your suggestions and neither one worked. :-(

The cell is in general format. I also tried number format and that did not work either.

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
Originally Posted by mlrnet
Hello,
I want to show blank cells, no zeros.
..in which case the supplied formatting rule in post#4 does the job. granted you may want to remove the red colouring for negative numbers but thats easily dooable. just remove the [red]

what is NETD(X,Y)?

the only time I'd worry about whether there is a 0 or not in a cell woudl be if I was using the domain statistical function such as AVG, STDDEV and so on, as in those functions 0 is not the the same as nothing

9. Registered User
Join Date
Sep 2008
Location
London, UK
Posts
511
If you still don't have a solution which works then please zip/attach a simple example for us to see.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•