# How to delete away the formula, if the cell is blank??

#### ru_1985

##### New Member
HI ALL.

How can i delete away the formula, when the is no value in it?
Or is there anyway to delete away e ZERO in the graph... so tat the line graph will not shown ZERO and it will left a blank...

Code:
=IF(INDEX('AML101-ETCH'!B13:B47,MATCH('POLY ETCH CD DATA'!B17,'AML101-ETCH'!A13:A47,1))=0,"",INDEX('AML101-ETCH'!B13:B47,MATCH('POLY ETCH CD DATA'!B17,'AML101-ETCH'!A13:A47,1)))

### Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

#### eliW

##### Well-known Member
Hi,

Try to replace the "" in your formula with NA()

This will be interpreted in the graph as "no data"

HTH

Eli

#### tusharm

##### MrExcel MVP
Re: How to get rid of the zero value in the line chart?

As has been pointed out, you need to use NA() instead of "". But, if you decide to use 2 cells instead of trying to squeeze everything into 1 cell, you can also improve the performance and maintainability of your workbook. In one cell, put the INDEX function. In the adjacent cell, put =IF({cell-with-index}=0,NA((),{cell-with-index}). Plot the 2nd cell (i.e., the one with the IF).

Now, you no longer duplicate the INDEX().

HI ALL.

How can i delete away the formula, when the is no value in it?
Or is there anyway to delete away e ZERO in the graph... so tat the line graph will not shown ZERO and it will left a blank...

Code:
=IF(INDEX('AML101-ETCH'!B13:B47,MATCH('POLY ETCH CD DATA'!B17,'AML101-ETCH'!A13:A47,1))=0,"",INDEX('AML101-ETCH'!B13:B47,MATCH('POLY ETCH CD DATA'!B17,'AML101-ETCH'!A13:A47,1)))

#### ru_1985

##### New Member
But i will like to delete away the formula, if the cell is blank...

#### Joe4

I think you may require a macro, something like this that will delete the formula:
Code:
Sub MyDeleteFormula()

Dim myRange As Range
Dim myCell As Range

'   Set range to check
Set myRange = Range("A1:A10")

'   Loop through each cell in range and delete contents if value is blank
For Each myCell In myRange
If myCell.Value = "" Or myCell.Value = 0 Then myCell.ClearContents
Next myCell

End Sub

#### ru_1985

##### New Member
ThanKS ALot thE cOdE work....

Replies
22
Views
2K
Replies
17
Views
436
Replies
1
Views
665
Replies
5
Views
237
Replies
9
Views
204

1,141,155
Messages
5,704,618
Members
421,360
Latest member
Rhodia

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back