1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How do you correctly format a number to be comma separated?

Imagine you have the number 2000000 (no decimals are required), which you want to format as 2,000,000. If you implement the following custom formatting [EDIT: the outcome here seems to depend on ones regional settings]

#,##0

Then you will get 2000,000 which is just wrong. If you implement the following formatting:

#,###,##0

You will seemingly get the correct formatting, but if you deploy this formatting on a cell with the value of 0, the output will be:

,,0

Thus there doesn't seem to be a "universal" solution to this. I could use multiple different formattings to achieve what I want, but I am wondering if I am missing something bigger. Is there just one formatting I could use?

submitted by /u/TonIvideo
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#rows.com
#Excel compatibility
#Excel alternatives for data analysis
#financial modeling with spreadsheets
#number formatting
#comma separated
#custom formatting
#formatting code
#Excel
#thousands separator
#regional settings
#formatting issue
#correct formatting
#zero value
#output
#cell value
#number representation
#cell formatting
#universal solution
#decimal places