Formulas with no results

S

Sondra

I'm creating an invoice, I would like to to set up the formulas up for all
cells so that even if they do not yet have any information there would be an
end result. An item could be entered on any line and the invoice will work.
If no item information is entered there should not be anything displayed;
however, in the Total Price cells, the resulting number should be formatted
to show dollars and cents, but if nothing is entered the cell should display
a dash only.

My biggest issue is formatting the "Total Price" cell to show a dash if
nothing is entered.

Thanks in advance.
 
G

Gary''s Student

A very simple example. Say we have:

=A1+A2

Instead use:

=IF(OR(A1="",A2=""),"-",A1+A2)

Now if either A1 or A2 is empty, a dash is displayed rathr than the sum.

Adjust cells to suit.
 
A

Adnan

Sondra,

In order for you to show a dash in "Total Price" cell, you will have to
format this cell as Accounting, to do so select that particular cell and then
navigate to Format > Cells > Number tab > select Accounting > OK


HTP
Adnan

If I have helped and/or answered your question, please let me know by
replying or clicking question answered (below positioned ‘Yes’ button).
 
F

Fred Holmes

In [Excel 2000] look up "Create a Custom Number Format" in the help.

Select the cell to be formatted.

Format => Cells => Number => Custom

And type in the formatting code you want. (or select an available one
and modify it.)

The code for formatting a number has four elements, separated by
semicolons:

[format for positive numbers];[format for negative numbers];[format
for zero];[format for text]

In the format for zero, enter "-" (including the quotation marks) for
just a hyphen to show. Add a space or more after the hypen to offset
it from the right margin. To add a space of an explicit width, type
in an underscore character followd by the character whose width is to
be duplicated by the space. Click on the various links in the help to
find all the goodies available.

The following formating code might do what you want:

$#,##0.00;-$#,##0.00;"-"

HTH

Fred Holmes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top