|First, some terminology...|
Conditional formatting is used to change the format of a cell when the specified condition(s) is(are) TRUE. Thus the name Conditional formatting.
You are asking for the contents (not the format) of the cell to change based on the value in another cell.
That is done with a basic IF function, which you can find in the Excel Help files.
However, you left out a condition. You didn't tell us what you want to display if D40 equals 0 - assuming that that is possible.
What should be displayed in A40 if D40 = 0?
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.