{"id":262662,"date":"2024-03-13T20:08:09","date_gmt":"2024-03-13T19:08:09","guid":{"rendered":"https:\/\/www.sheetgo.com\/?p=262662"},"modified":"2026-11-02T15:20:46","modified_gmt":"2026-11-02T14:20:46","slug":"combinar-linhas-no-excel","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/excel-features\/consolidate-rows-in-excel\/","title":{"rendered":"Como combinar linhas no Excel e consolidar dados duplicados"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;4.16&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; da_is_popup=&#8221;off&#8221; da_exit_intent=&#8221;off&#8221; da_has_close=&#8221;on&#8221; da_alt_close=&#8221;off&#8221; da_dark_close=&#8221;off&#8221; da_not_modal=&#8221;on&#8221; da_is_singular=&#8221;off&#8221; da_with_loader=&#8221;off&#8221; da_has_shadow=&#8221;on&#8221; da_disable_devices=&#8221;off|off|off&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>When working with Excel spreadsheets, one of the most common tasks is to merge or combine data from different worksheets. Although this may seem like a simple procedure, it\u2019s likely that you\u2019ll end up with duplicate entries. If your dataset is small, these duplicates might be easier to spot and quickly removed. However, this entails manual work, and it can become overwhelming if you work with high-volume data. Excel offers two different features that can help you achieve this in a quick and efficient way.<\/p>\n<p>In this article, you\u2019ll learn how to combine duplicate rows and sum the values in Excel using three methods. First, you\u2019ll see how to combine duplicates using the consolidate function in Excel. Second, a more advanced method involves using VBA code to merge duplicates in Excel. As a third alternative option to using Excel, you&#8217;ll learn how Sheetgo, an AI-powered data automation platform, can <a href=\"https:\/\/www.sheetgo.com\/blog\/how-to-solve-with-sheetgo\/consolidate-excel-files-automatically\/\">consolidate Excel files automatically<\/a>.<\/p>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;how-to-combine-duplicate-rows-and-sum-th&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>How to combine duplicate rows and sum the values in Excel?<\/h2>\n<p>Excel offers many features to help you carry out complex tasks in a quick and easy way. Here, you\u2019ll learn how to combine duplicates in Excel following two useful methods.<\/p>\n<h3>Combine duplicate rows with the Consolidate function in Excel<\/h3>\n<p>The consolidate feature in Excel can be used to <a href=\"https:\/\/www.sheetgo.com\/blog\/excel-features\/consolidate-data-in-excel\/\">consolidate multiple worksheets<\/a> or rows in Excel. This is how you can combine and add rows in Excel using the consolidate function.<\/p>\n<p><strong>1.<\/strong> Open Excel and click on the cell where you want to place the combined data result.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-select-cell.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 empty cell selected next to the loan data table on the Home tab&#8221; title_text=&#8221;Empty cell selected next to the loan data table on the Home tab&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Go to Data &gt; Consolidate.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-data-consolidate.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 Consolidate button on the Data tab of the ribbon&#8221; title_text=&#8221;Consolidate button on the Data tab of the ribbon&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> From the \u201cFunctions\u201d drop-down list, select \u201cSum\u201d. Click on the upwards arrow button to select the cell range that you wish to consolidate.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-consolidate-sum.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 Consolidate dialog with Sum selected in the Function list&#8221; title_text=&#8221;Consolidate dialog with Sum selected in the Function list&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>4.<\/strong> Select the cell range you want to combine in the worksheet, then click the arrow button again to return to the Consolidate dialog.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-select-range.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 collapsed Consolidate Reference box holding the selected range&#8221; title_text=&#8221;Collapsed Consolidate Reference box holding the selected range&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>5.<\/strong> Click on the \u201cAdd\u201d button to include the cell reference in the \u201cAll references\u201d space.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-add-reference.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 range in the Reference field next to the Add button&#8221; title_text=&#8221;Range in the Reference field next to the Add button&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>6.<\/strong> Select the \u201cTop row\u201d and \u201cLeft column\u201d options from the \u201cUse labels in\u201d group. Once you finish, click \u201cOK\u201d to apply changes.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-use-labels.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 range listed under All references, with Top row and Left column checked&#8221; title_text=&#8221;Range listed under All references, with Top row and Left column checked&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>Note:<\/strong> If your data range doesn\u2019t have header rows, then leave the \u201cTop row\u201d option cleared.<\/p>\n<p><strong>7.<\/strong> You should now see a new list of rows containing only unique values. Any value corresponding to the same record will be summed up.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-consolidated-result.webp&#8221; alt=&#8221;Combine rows in Excel \u2014 consolidated list of unique names with their values summed&#8221; title_text=&#8221;Consolidated list of unique names with their values summed&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>This method is a good option if you don\u2019t mind losing the original data; however, if you\u2019d like to keep the original values of duplicates, then make a copy of the worksheet and apply this method in the copy version.<\/p>\n<h3>Merge duplicate rows with VBA code<\/h3>\n<p>One of the main advantages of processing data in VBA is that you can record a macro of your action and then run it every time you need to perform a similar task in the future. In other words, you have the option of automating the task of combining data. This is how you can merge duplicates using VBA in Excel.<\/p>\n<p><strong>1.<\/strong> Select the range of cells that you\u2019d like to consolidate and go to Developer &gt; Visual Basic for Applications.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-vba-developer-tab.webp&#8221; alt=&#8221;Merge rows in Excel with VBA \u2014 Visual Basic button on the Developer tab&#8221; title_text=&#8221;Visual Basic button on the Developer tab&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>2.<\/strong> Select Insert &gt; Module.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-vba-insert-module.webp&#8221; alt=&#8221;Merge rows in Excel with VBA \u2014 Insert menu in the VBA editor with Module highlighted&#8221; title_text=&#8221;Insert menu in the VBA editor with Module highlighted&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>3.<\/strong> Type the macro shown in the screenshot below into the Module window.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-vba-code.webp&#8221; alt=&#8221;Merge rows in Excel with VBA \u2014 MergeRowsSumValues macro pasted into the module window&#8221; title_text=&#8221;MergeRowsSumValues macro pasted into the module window&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>4.<\/strong> Press \u201cF5\u201d to run this macro or click on the \u201cPlay\u201d icon, as shown below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-run-macro.webp&#8221; alt=&#8221;Merge rows in Excel with VBA \u2014 Run Sub\/UserForm (F5) button above the macro code&#8221; title_text=&#8221;Run Sub\/UserForm (F5) button above the macro code&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p><strong>5.<\/strong> Excel creates a new workbook with your merged rows and added data, as shown below.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2026\/10\/combine-rows-in-excel-merged-workbook.webp&#8221; alt=&#8221;Merge rows in Excel with VBA \u2014 new workbook listing each name with its summed annual compounding period&#8221; title_text=&#8221;New workbook listing each name with its summed annual compounding period&#8221; align=&#8221;center&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; width=&#8221;100%&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<p>Although Excel consolidates rows in efficient ways, you still need to put in some effort on your part. <a href=\"https:\/\/www.sheetgo.com\/automations\/\">Sheetgo<\/a>, an AI-powered data automation platform, can also do the consolidation step for you. It merges rows from several Excel, Google Sheets, or CSV files into one sheet and refreshes it on a schedule.<\/p>\n<p>[\/et_pb_text][et_pb_text module_id=&#8221;conclusion&#8221; _builder_version=&#8221;4.22.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<\/p>\n<h2>Conclusion<\/h2>\n<p>Although the first method is easier to execute, it can\u2019t process the two columns not next to each other. VBA is more convenient in case you want to reuse the function in the future, but it requires more coding knowledge. Another advantage of VBA is that it won\u2019t alter the original worksheet, as the data is merged into a new file.<\/p>\n<p>You should now be able to consolidate duplicates in Excel depending on whether you\u2019d prefer to keep the original values or not. In case you want Excel to fully consolidate rows with multiple columns, the consolidate feature is a quick and easy-to-use method. If you prefer to consolidate rows in Excel based on more complex criteria and keep the original values intact, then using the VBA code to consolidate is the best option for you. Alternatively, Sheetgo can make this process easier and faster, since its AI-powered automations run the merge for you on a schedule.<\/p>\n<p>If you want to learn more about consolidating data in Excel, check out these articles below:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.sheetgo.com\/blog\/excel-features\/how-to-aggregate-data-in-excel\/\">How to aggregate data in Excel (multiple ways)<\/a><\/li>\n<li><a href=\"https:\/\/golayer.io\/blog\/excel\/combine-csv-files\/\" target=\"_blank\" rel=\"noopener\">Combine multiple CSV files into one Excel file (multiple methods)<\/a><\/li>\n<li><a href=\"https:\/\/www.sheetgo.com\/blog\/excel-features\/consolidate-data-in-excel\/\">How to consolidate data in Excel (step-by-step)<\/a><\/li>\n<li><a href=\"https:\/\/www.sheetgo.com\/blog\/excel-features\/combine-multiple-columns-in-excel-into-one-column\/\">How to combine multiple Excel columns into one?<\/a><\/li>\n<li><a href=\"https:\/\/www.sheetgo.com\/blog\/how-to-solve-with-sheetgo\/merging-excel-files\/\">How to merge multiple Excel files into one<\/a><\/li>\n<li><a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/sumif-excel\/\">How to use the SUMIF function in Excel<\/a><\/li>\n<li><a href=\"https:\/\/www.sheetgo.com\/blog\/excel-functions\/concatenate-excel\/\">How to use the CONCATENATE function in Excel<\/a><\/li>\n<\/ul>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aprenda a combinar linhas no Excel e somar valores duplicados com o recurso Consolidar ou com uma macro VBA. Cada m\u00e9todo traz instru\u00e7\u00f5es passo a passo.<\/p>","protected":false},"author":2,"featured_media":262675,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[51],"tags":[],"class_list":["post-262662","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-features"],"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/262662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=262662"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/262662\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/262675"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=262662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=262662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=262662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}