Excel Coding Problem

F

Fraggs

What I'm trying to do is, if no data is entered into a cell, then th
cell displays the "-" symbol. Below is the code I am working on t
make this happen but its not working. Can anybody help mw with this?

=IF(SUMIF(M16/G160),"-")

Thanks
 
F

Frank abel

Hi
try
=IF(OR(M16="",G160=""),"-",M16/G160)

Note: this does NOT take care of the #DIV/0 error. For
this you may use
=IF(OR(M16="",G160="",G160=0),"-",M16/G160)
 
B

Bob Phillips

Which cell, M16 or G16? And why are you using SUMIF?

If G16 can be empty, you should code for it

=IF(G16="","", etc

Then if M16 can also be empty, something like

=IF(G16="","",IF(M16="","-",M16/G16))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
F

Fraggs

That works great thanks but I forgot to mention I only want the "-
symbol to appear if no data is enterd in the corresponding cells. Whe
I entyer data into the said cells the "-" stays in the sum cell. Don
suppose you know how to fix this aswell do you?

Thanks again
 
Top