Convert zero to hyphen"-" and number formatting in cells for multiple columns at the same time

MKLAQ

Active Member
Joined
Jan 30, 2021
Messages
388
Office Version
  1. 2016
Platform
  1. Windows
hi experts

I use normal way bye cell format by choose the cells and customize to make any value = 0 should convert to "-" and when make the cells contain numbers. it should show the numberformat #,#00.0 so far is ok , but if I use customize to make any value = 0 should convert to "-" .it will clear number format then the cells it will be like this ##### without any numberfromat . the question is. is there any macro or way to make value = 0 convert to "-" show the numberformat #,#00.0 at the same time without return the normal value .for instance I have columns B,F,H,M,N contains some numbers and zero .

I appreciate if anybody solve this dilemma

thanks in advance
 
thanks . is there way to make the empty cell conatain "-"?
the empty cell or cell contain 0 should convert to "-"
I don't believe there is a way of making an empty cell display "-".
If you are populating the column with a formula and are returning "" then change that to a zero.
In a pivot table it will also effectively convert to zero and the number formatting will apply to it.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Manually solution:
Select range of data
Ctr-G (GoTo), Select Special/ Blanks
Now all Blank Cells in range are hightlied
Ctrl-H( Find And Replace)
Find What: Leave blank
Replace with: -
OK
 
Upvote 0
I don't believe there is a way of making an empty cell display "-".
that make me going back in post#4 why doesn't work. do you work for you?
 
Upvote 0
I don't know why my post #4 is not working for you unless it is the Rich text or that I modified it to 1 decimal manually.
Here it is again with 2 decimlas if you want to try copy pasting it into the custom box
_(* #,##0.00_);[Red]_(* (#,##0.00);_(* "-"??_);_(@_)

It might be overkill for what you need.
Here is the breakdown with examples.

I can see no way of formatting an empty cell as "-" though.

1636770525700.png
 
Upvote 0

Forum statistics

Threads
1,214,807
Messages
6,121,679
Members
449,047
Latest member
notmrdurden

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