Sum if same ID and same date - only once

Mariella

New Member
Joined
Jan 12, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I am trying to sum quantities in a database. Thereby it is important that for each ID, when the date is the same, the value is only added once. I am absolutely struggling to calculate that.

Maybe someone can help me? I would really appreciate it!

Best,
Mariella
 

Attachments

  • simplifiedExcel.PNG
    simplifiedExcel.PNG
    15.8 KB · Views: 49
select your original table
from the ribbon Data - From Table
then in Power Query Editor open Advanced Editor
and replace all code there with code copied from the post
then Done , Close&Load

after that:
totalrow.gif

Cool!! Thank you :)
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I would have to list the options before
Well, we could do that with a formula as well, but with that many rows I suspect the SUMPRODUCT formula would slow the sheet down considerably. :(

Book1
ABCDEFG
1iddateqtyIDSum Once
2112/12/20195119
3113/12/20195211
427/12/2019536
5313/12/20196
6213/12/20196
7213/12/20196
827/12/20195
9112/12/20195
10110/12/20199
Sum
Cell Formulas
RangeFormula
F2:F4F2=IFERROR(INDEX($A$2:$A$10,MATCH(0,INDEX(COUNTIF($F$1:F1,$A$2:$A$10)+(A$2:A$10=""),0),0)),"")
G2:G4G2=SUMPRODUCT((A$2:A$10=F2)*(MATCH(A$2:A$10&"|"&B$2:B$10,A$2:A$10&"|"&B$2:B$10,0)=ROW(A$2:A$10)-ROW(A$2)+1),C$2:C$10)
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,835
Members
449,192
Latest member
mcgeeaudrey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top