{"id":5158,"date":"2020-04-22T14:34:38","date_gmt":"2020-04-22T14:34:38","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=5158"},"modified":"2024-03-29T14:12:05","modified_gmt":"2024-03-29T14:12:05","slug":"add-commas","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/","title":{"rendered":"Add Commas in Excel"},"content":{"rendered":"\n

When you deal with several cells inside your spreadsheet data, adding commas manually in particular places inside cells may be a good decision, but when you deal with a huge amount of data you have to find a better way to do it.<\/p>\n\n\n\n

This is where formulas come into play.<\/p>\n\n\n\n

Add a comma after the first word<\/h2>\n\n\n\n

Let’s use this example:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Here, we have a list of names: last name and first name. In this case, there should be a comma after the first word, otherwise, someone might confuse the name with the name.<\/p>\n\n\n\n

We are going to use two formulas that return the same result.<\/p>\n\n\n\n

SUBSTITUTE<\/h3>\n\n\n\n

The SUBSTITUTE<\/a> function replaces one part of a string with another string.<\/p>\n\n\n\n

=SUBSTITUTE(A2,\" \",\", \")<\/code><\/pre>\n\n\n\n

This formula is going to replace ” ” with “, “. In other words, it will add comma and space where there are spaces inside our example.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

It works great, but look at what happens if there is somebody with two names.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

There are many cases that this is what you need, but in our case, we want Excel to place a single comma, after the first word.<\/p>\n\n\n\n

That’s easy, all you need to do is to add is an optional parameter to the SUBSTITUTE function.<\/p>\n\n\n\n

This parameter specifies how many times you want to make a substitute. Because we want to add a single comma, therefore we add number 1.<\/p>\n\n\n\n

=SUBSTITUTE(A2,\" \",\", \", 1)<\/code><\/pre>\n\n\n\n

After this change, our example is going to look like this:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

REPLACE and FIND<\/h3>\n\n\n\n

The second example is a combination of functions: REPLACE<\/a> and FIND<\/a>.<\/p>\n\n\n\n

=REPLACE(A2,FIND(\" \",A2),0,\",\")<\/code><\/pre>\n\n\n\n

It’s going to return the same result as the formula with the SUBSTITUTE function.<\/p>\n\n\n\n

Before I explain how the REPLACE<\/strong> function works, let’s see what FIND<\/strong> does in our example.<\/p>\n\n\n\n

Type this formula into cell B2<\/strong>, and autofill<\/a> for the rest of the cells:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

The FIND function returns the position of the first argument in a cell. In our case, the first occurrence of space.<\/p>\n\n\n\n

Now, when we know that, let’s analyze the whole formula.<\/p>\n\n\n\n

=REPLACE(A2,FIND(\" \",A2),0,\",\")<\/code><\/pre>\n\n\n\n

First, the REPLACE<\/strong> function takes a text to change.<\/p>\n\n\n\n

In the second argument, the FIND<\/strong> function returns a position of the first occurrence of space.<\/p>\n\n\n\n

The third argument specifies how many characters we want to replace. We don’t want to replace any characters, because we just want to insert a comma before space.<\/p>\n\n\n\n

In the last argument, we have to specify which character we want to insert. It’s a comma in our case.<\/p>\n","protected":false},"excerpt":{"rendered":"

When you deal with several cells inside your spreadsheet data, adding commas manually in particular places inside cells may be a good decision,…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[190],"yoast_head":"\nAdd Commas in Excel<\/title>\n<meta name=\"description\" content=\"Learn how to use formulas to add commas to spreadsheet data. Find out how to add a comma after the first word in a cell using the SUBSTITUTE function.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Commas in Excel\" \/>\n<meta property=\"og:description\" content=\"Learn how to use formulas to add commas to spreadsheet data. Find out how to add a comma after the first word in a cell using the SUBSTITUTE function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-22T14:34:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-29T14:12:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Add Commas in Excel\",\"datePublished\":\"2020-04-22T14:34:38+00:00\",\"dateModified\":\"2024-03-29T14:12:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\"},\"wordCount\":409,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png\",\"keywords\":[\"pinterest\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\",\"name\":\"Add Commas in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png\",\"datePublished\":\"2020-04-22T14:34:38+00:00\",\"dateModified\":\"2024-03-29T14:12:05+00:00\",\"description\":\"Learn how to use formulas to add commas to spreadsheet data. Find out how to add a comma after the first word in a cell using the SUBSTITUTE function.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage\",\"url\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png\",\"contentUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png\",\"width\":225,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Commas in Excel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add Commas in Excel","description":"Learn how to use formulas to add commas to spreadsheet data. Find out how to add a comma after the first word in a cell using the SUBSTITUTE function.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/","og_locale":"en_US","og_type":"article","og_title":"Add Commas in Excel","og_description":"Learn how to use formulas to add commas to spreadsheet data. Find out how to add a comma after the first word in a cell using the SUBSTITUTE function.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/","article_published_time":"2020-04-22T14:34:38+00:00","article_modified_time":"2024-03-29T14:12:05+00:00","og_image":[{"url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Add Commas in Excel","datePublished":"2020-04-22T14:34:38+00:00","dateModified":"2024-03-29T14:12:05+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/"},"wordCount":409,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png","keywords":["pinterest"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/","url":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/","name":"Add Commas in Excel","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png","datePublished":"2020-04-22T14:34:38+00:00","dateModified":"2024-03-29T14:12:05+00:00","description":"Learn how to use formulas to add commas to spreadsheet data. Find out how to add a comma after the first word in a cell using the SUBSTITUTE function.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/add-commas\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#primaryimage","url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png","contentUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2020\/04\/example.png","width":225,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/add-commas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Add Commas in Excel"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/5158"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=5158"}],"version-history":[{"count":3,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/5158\/revisions"}],"predecessor-version":[{"id":13294,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/5158\/revisions\/13294"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=5158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=5158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=5158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}