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

MKLAQ

Active Member
Joined
Jan 30, 2021
Messages
397
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
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I am not really clear on what you mean.
If you are referring to customer number formatting and you only want it to 1 decimal place here is a slightly modified version of what I normally use.
Try it and if it is not what you want give us some examples of values and how you expect them to look,
Rich (BB code):
_(* #,##0.0_);[Red]_(* (#,##0.0);_(* "-"?_);_(@_)
 
Upvote 0
this is what I want
HEADERS.xlsm
JKLMN
5122.0010.00-1,000.001,000.00
610,000.002,000.00-200.00100.00
73,000.00----
8---500.00-
91,000.00-7,000.00600.00-
10-----
RESULT
 
Upvote 0
So did you try the custom formatting I provided ?
Your initial example indicated 1 decimal place for 2 decimals change it back to my standard of:
Rich (BB code):
_(* #,##0.00_);[Red]_(* (#,##0.00);_(* "-"??_);_(@_)
 
Upvote 0
So you went into Format Cells > Number > Custom >
And in the Type box pasted in the line from my post ?
Then what happened.
 
Upvote 0
I have logged off for the day but I think the Accounting Format will do what you want. Just select Symbol = None
 
Upvote 0
Excel can't use the numbers formatting you typed
 
Upvote 0
thanks . is there way to make the empty cell conatain "-"?
the empty cell or cell contain 0 should convert to "-"
 
Upvote 0

Forum statistics

Threads
1,215,415
Messages
6,124,768
Members
449,187
Latest member
hermansoa

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