Custom cell format

PATSYS

Well-known Member
Joined
Mar 12, 2006
Messages
1,750
How do I make the cell format in such a way that if the value is zero, what should appear is "-", if the value is negative, then it has to be with red font color, and if positive, just the normal font color. And all these with no decimals and with comma separator for thousands.

Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Good morning PATSYS

This format worked OK for me. Beware of typos, as you can't copy and paste into the custom format box - I think I've reproduced the format faithfully below - post back if you can't make it work :

[=0],"-";[Red][<1]#,##0;#,##0

HTH

DominicB

Edit : Slight correction
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
55,784
Office Version
  1. 365
Platform
  1. Windows
..perhaps this?
#,##0;[Red]#,##0;"-"
or
#,##0;[Red]-#,##0;"-"
 

Forum statistics

Threads
1,171,579
Messages
5,876,288
Members
433,192
Latest member
butterexcel

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
Top