Forum Discussion
Warwick03
Oct 13, 2022Copper Contributor
Output The Sum of Cells If More Than One Row Has The Same Information
Hi does anyone know how I would combine multiple rows if they had the same information.
This is a very small scale but i didnt know if there was a way I could combine the cells if they had the same: Month, year and code. But then add the quantity and price together?
I have 5000 rows so I cant add a code for each row.
Month | Year | Qty | Price | Code |
july | 2022 | 50 | £2,100 | 106879 |
july | 2022 | 60 | £2,200 | 106879 |
august | 2022 | 60 | £2,200 | 106879 |
august | 2022 | 60 | £2,200 | 106877 |
You can try Power Query. In the attached file you can enter additional data in the dynamic table in columns A-E. Then click in any cell in the green table, right-click and refresh.
- OliverScheurichGold Contributor
=SUMIFS(C$2:C$5,$A$2:$A$5,$G2,$B$2:$B$5,$H2,$E$2:$E$5,$I2)
You can apply SUMIFS. In the example the formula is in cell J2 and filled across range J2:K4.
- Warwick03Copper ContributorHi this kind of helps. But I dont want to input each month and code as there are hundreds of codes...
- OliverScheurichGold Contributor
You can try Power Query. In the attached file you can enter additional data in the dynamic table in columns A-E. Then click in any cell in the green table, right-click and refresh.