{
  "id": 15665658,
  "title": "Excel custom number format: add units without breaking SUM",
  "url": "https://urgent.news/2026/10/19/excel-custom-number-format-add-units-without-breaking-sum",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-19T22:40:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/hodadak_official/excel-custom-number-format-add-units-without-breaking-sum-2e00"
  },
  "original_language": "en",
  "account": "When working with expense sheets and price lists, it's common to need units after numbers, such as currency names or other measurements. Typing the unit directly into the cell is quick but can lead to issues. Once a cell contains a number formatted as text, such as \"25,000원\" (25,000 won, Korean currency), Excel stops treating it as a numeric value, causing the SUM function to skip over it. In a test sheet, the correct total was 194,500 won, but with units typed in by hand, the SUM function returned an incorrect total of 41,500.\n\nTo avoid this problem, keep the cell as a number and use a custom number format to display the unit. Select the cells with amounts, press Ctrl + 1 to open the number format options, choose the Custom category, and type a format in the format box. For example, #,##0 원 displays the number with a thousands separator and the Korean currency unit. The values themselves remain unchanged; only the display format is altered. After applying the custom format, the total correctly shows as 194,500원, and new numbers entered into those cells display the unit automatically (e.g., 40,000원).\n\nThis method works the same in Excel for the web, using the Korean interface. The format code #,##0 signifies a whole number with a thousands separator, while anything inside double quotes is printed as-is. Replace 원 with the desired unit, such as pcs for pieces, kg for kilograms, or #,##0.00 USD for formatted US dollars. Adding a space within the quotes creates a gap.\n\nA common mistake is fixing the format but not the data. If cells already contain typed text like \"25,000원\", the format won't convert them. Retype the numbers or use Find and Replace to strip the unit first. Forgetting to include quotes around the unit can also cause issues. Exporting to CSV isn't a concern because the unit is part of the format, not the value, so the CSV will contain plain numbers. In code, the same format string applies wherever Excel number formats are accepted, such as in openpyxl or VBA. In openpyxl, set the number_format property of a cell to #,##0 pcs, and in VBA, use Range(C2:C10).NumberFormat = #,##0 pcs (note the doubled quotes inside a VBA string). Both methods keep the values numeric, ensuring formulas that read those cells continue to work correctly.",
  "summary": "Expense sheets and price lists often need a unit after the number: a currency name, \"pcs\", \"kg\". The quick way, typing it straight into the cell, has a cost that's easy to miss. The moment a cell contains 25,000원 (25,000 won, Korean currency) as typed text, Excel stops treating it as a number, and SUM silently skips it. In our test sheet, the correct total was 194,500. With the unit typed into…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}