Calculate Total Quantity

Bindi_Baji

New Member
Joined
Jul 28, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I'm hoping somebody could offer a suggestion for a method to calculate the total order amount of a given item within VBA.
Basically, we have numerous items which need to be worked through to figure our the total order for each item. The issue I'm having is because of the way our stock system exports the data.
Please see below example of one item:
(cant install mini sheet on work laptop unfortunately.)
1659007150202.png


Essentially, the total order for Item 10001 should be 120 + 100 + 75 + 80 + 100 + 120 + 260 = 855

I hoping to find a method of calculating this on the fly for each item in a VBA procedure but having real trouble getting my head round the calculations.
We have hundreds of different customers so unfortunately I'm not sure filtering on these would be effective.

Any help would be gratefully received
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I have a hard time understanding how to go from the data table to the calculated example you show, the numbers do not appear to match up?
 
Upvote 0
I have a hard time understanding how to go from the data table to the calculated example you show, the numbers do not appear to match up?
It appears to me that they are wanting to sum up the "Total Order" column, when you remove all duplicates (based just on the "Custmer" and "Total Order" columns).
 
Upvote 0
It appears to me that they are wanting to sum up the "Total Order" column, when you remove all duplicates (based just on the "Custmer" and "Total Order" columns).
Essentially, yes.
So as an example, Cust2 has ordered 100 units of Item 10001.
This is picked from 3 sites in 40 + 40 + 20 but our system doesn't amend the Total Order column.
Cust2 gets what they want (100 units) but system seems to suggest the Total Order is 300 units.
 
Upvote 0
Hi & welcome to MrExcel.
You can do that with a formula, if your interested.
Fluff.xlsm
ABCDEF
1
210001Cust112010001855
310001Cust2100
410001Cust2100
510001Cust2100
610001Cust375
710001Cust375
810001Cust480
910001Cust5100
1010001Cust5100
1110001Cust6120
1210001Cust7260
Data
Cell Formulas
RangeFormula
F2F2=LET(f,FILTER(B2:D1000,A2:A1000=E2),r,ROWS(f),c,INDEX(f,,1),SUM(FILTER(INDEX(f,,3),MMULT((SEQUENCE(r)>=SEQUENCE(,r))*(c=TRANSPOSE(c)),SEQUENCE(r,,,0))=1)))
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,011
Members
448,935
Latest member
ijat

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