{"id":112,"date":"2020-02-19T02:28:00","date_gmt":"2020-02-19T02:28:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=112"},"modified":"2024-02-08T08:16:59","modified_gmt":"2024-02-08T13:16:59","slug":"removing-characters-from-excel-cells","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/removing-characters-from-excel-cells\/","title":{"rendered":"Removing characters from Excel cells"},"content":{"rendered":"\n<p>Sometimes Excel cells contain unwanted data. Removing this data can be a very tedious job. For example, I recently received a data file where the first column cells contained some numeric identifiers. The problem was that the number were typed as #123456, #123457, etc. I only needed the numbers without # symbol for my software to process this data. Since it was not possible for me to manually edit over 20000 rows, I used the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>=right(A1,len(A1)-1)<\/code><\/pre>\n\n\n\n<p>The cell we need to edit is A1. len(A1) returns the length of the text in the cell. The right function removes characters from the beginning of the string. len(A1) &#8211; 1 specifies the size of the new string, which is one character less than the original, so the # symbol is removed from the string. Next, we simply drag down the selector to apply this formula to every row.<\/p>\n\n\n\n<p>There is also a left function which removes characters from the end of the string.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>=right(A1,len(A1)-2)   removes first 2 characters\n=left(A1,len(A1)-2)    removes last 2 characters<\/code><\/pre>\n\n\n\n<p>You can also use the search replace command to edit text.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes Excel cells contain unwanted data. Removing this data can be a very tedious job. For example, I recently received a data file where the first column cells contained some numeric identifiers. The problem was that the number were typed as #123456, #123457, etc. I only needed the numbers without # symbol for my software [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[207,369],"tags":[56],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-excel","category-microsoft-office","tag-microsoft-excel"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=112"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/112\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}