If Formula with Sum to replace 0 with Hyphens

Manny74

Board Regular
Joined
May 6, 2016
Messages
124
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi All, I am trying to create a formula to replace a blank or zero with a hyphen for each quarter...I feel as though I am close to figuring this out.
for 1st Qtr, I typed =IF(C3+D3+E3=0,"-",SUM(C3:E3)) and it seemed to work..
But couldn't I type =IF(SUM C3:3=0,"-",SUM(C3:E3)) ?


COLUMN BCDEFGHIJKLMNOPQR
ROW 2 JanFebMar1st QtrAprMayJune2nd QtrJuly AugSept3rd QtrOctNovDec4th Qtr
ROW 3Complaints-000
 
You're welcome & thanks for the feedback
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hello All,
I have another question...

So I have this formula for 1st Qtr, so that if there are zero complaints, then 1st Qtr will be zero....

But I'm also trying to calculate the number of complaints divided by total surveys, so I can get a percentage for each category

I used this formula--- IF(COUNT(F3/F8)=0,"-",F3/F8)

But if there are zero complaints for Jan, Feb & March, I'd like to see % as zero.....How should I adjust my formula?

If Jan Feb Mar are blank I'd like % to have a hyphen, and if Jab Feb Mar are zeros, then I'd like % to be zero....




COLUMNBCDEFG
ROW 2 JanFebMar1st Qtr%
ROW 3Complaints
0​
000-
ROW 4Grievances--
ROW 5Positive Feedback
0​
000-
ROW 6Neutral Feedback--
ROW 7Negative Feedback--
ROW 8Total Surveys
0​
0​
0​
0-
 
Upvote 0
I'm not sure why you used COUNT, that just counts how many numbers; F3/F8 unless it was #DIV/0 would only ever be 1 number.

=IF(SUM(C3:E3),IF(F3/F8,F3/F8,"-"),0)
 
Upvote 0
Hi Scott, I think I tried a recommended formula and it wasn't working...So then this was recommended: =IF(COUNT(C3:E3)=0,"-",SUM(C3:E3)) and it seemed to work.....

So now when I enter zero complaints for Jan, Feb & March, in 1st Qtr I get zero, which is what I want, and if I leave Jan, Feb & March blank, 1st Qtr is a hypen, which is what I want....so it seems to work...

So I tried your formula, IF(SUM(C3:E3),IF(F3/F8,F3/F8,"-"),0), and it seems to work....

But the % (column G) is 0% no matter what, even when the cell is blank....Is there a way to have G3 populate a hyphen when Jan Feb & March are zero?

Maybe not, but I thought I would ask...

Thanks for your patience...




COLUMNBCDEFG
ROW 2 JanFebMar1st Qtr%
ROW 3Complaints
0​
0000%
ROW 4Grievances-0%
ROW 5Positive Feedback
0​
0000%
ROW 6Neutral Feedback-0%
ROW 7Negative Feedback-0%
ROW 8Total Surveys
0​
0​
0​
00%
 
Upvote 0
I would like the G column (%) to have a hyphen when the cells for Jan, Feb & March are blank...

Also I would like the G column (%) to have a 0 in the cell when Jan, Feb & March is 0.....

I used IF(SUM(C3:E3),IF(F3/F8,F3/F8,"-"),0)

And so when there are zeros for Jan, Feb & March, the % cell is still a hyphen..... Is there a way to have it 0%?


COLUMNBCDEFG
ROW 2 JanFebMar1st Qtr%
ROW 3Complaints0000-
ROW 4Grievances--
ROW 5Positive Feedback0000-
ROW 6Neutral Feedback--
ROW 7Negative Feedback--
ROW 8Total Surveys0000-
 
Upvote 0
How about
=IFERROR(F3/F8,"-")
 
Upvote 0
Hi tried =IFERROR(F3/F8,"-")...It's a valid formula...
When Jan Feb & March are blank, then the % cell has a hyphen, which is great!
But what if I also want the % cell to populate zero (0%), if Jan Feb & March are zeros?
 
Upvote 0
As long as F8 isn't 0 then it will work.
 
Upvote 0
You will get a #DIV/0! error without the IFERROR function.
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top