ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Coding Problem (https://www.excelbanter.com/excel-programming/295645-excel-coding-problem.html)

Fraggs[_14_]

Excel Coding Problem
 
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

--
Message posted from http://www.ExcelForum.com


Frank abel

Excel Coding Problem
 
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)

-----Original Message-----
What I'm trying to do is, if no data is entered into a

cell, then the
cell displays the "-" symbol. Below is the code I am

working on to
make this happen but its not working. Can anybody help

mw with this?

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

Thanks.


---
Message posted from http://www.ExcelForum.com/

.


Bob Phillips[_6_]

Excel Coding Problem
 
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)

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

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

Thanks.


---
Message posted from http://www.ExcelForum.com/




Fraggs[_15_]

Excel Coding Problem
 
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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com