How to consolidate duplicates in Excel where several columns need to remain uncosolidated

*爱你&永不变心* 提交于 2020-01-07 02:38:26

问题


I am trying to do a stock count through product stores but have several part numbers that are listed twice (Column A). When I try to consolidate these I recieve the error 'no data consolidated' which I think is caused by Columns B-F (which will always be the same if Column A value is the same).

I want to consolidate the rows where columns A-F are the same, into a singular row with Column G representing the subtotal of Column F for all duplicate rows.

Screenshot of Corresponding Spreadsheet

I have searched the site and though there are people with similar problems, none of the answers have applied to my exact data. I can't use a pivot table because the parts are stored in so many places that it ends up being unreadable (see second attached picture).

Screenshot of Confusing Pivot table


回答1:


You can do this with a pivot table, you just need to make some adjustments to the display to get it looking like your current set of data.

First, set up a pivot table with the columns A-E in the rows, and column F in the values.

Next go to the Design area, and change the report layout to be Show in Tabular form.

Finally, go to the Subtotals, and select Do not show Subtotals.

This should give you the totals for each, and you should also be able to see if something is out of place in columns B-E, as there will be extra entries for misplaced items.
If you don't care about misplaced items, then the + symbol next to the part number will collapse the other pieces into a single line




回答2:


SUMIFS() Should solve your issue here. You can use something like =SUMIFS(F:F,A:A,A2,B:B,B2,C:C,C2,D:D,D2,E:E,E2) if it is essential that A-E match. This will give you a Column G with the result you are after however this way will also give you multiple rows.

IF B-E are always the same for a Column A value then you can always paste the unique Column A values in a separate sheet and then use =SUMIFS(Sheet1!F:F,Sheet1!A:A,Sheet2!A2)

and display something like this



来源:https://stackoverflow.com/questions/41985701/how-to-consolidate-duplicates-in-excel-where-several-columns-need-to-remain-unco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!