Calculate the total Qty

firstWeMeet

Board Regular
Joined
Feb 8, 2011
Messages
200
Hello, just having difficulties on how to calculate the Qty from my huge data, the data contains 13 columns, but the data which to compute is column D, I and K.
the column D is the Name, the I is the Item code, the K is the Qty, so I need to compute the Qty base from the Name and item code. how to execute it?
 
Hi,

Does this work for you?

Sample data and example result...

Excel Workbook
CDEFGHIJKLMNOP
1NameItem CodeQtyNameItem CodeTotal Qty
2Ben99999100Ben99999200
3Bob99998200200
4Bud99997300
5Bill99996400
6Brad99995500
7Ben99999100
8Bob99998200
9Bill99997300
10Brad99996400
11Bud99995500
12Ben9999100
13
Sheet1


The formula in O2 will work in Excel 2007 and later.
The formula in O3 will work in all versions of Excel.

I hope that helps.

Ak
 
Upvote 0
Hi,

Just change the column references from K to H....

Excel Workbook
CDEFGHIJKLMNOP
1NameQtyItem CodeNameItem CodeTotal Qty
2Ben10099999Ben99999200
3Bob20099998200
4Bud30099997
5Bill40099996
6Brad50099995
7Ben10099999
8Bob20099998
9Bill30099997
10Brad40099996
11Bud50099995
12Ben1009999
13
Sheet1


I hope that helps.

Ak
 
Upvote 0
Hi,

Does this work for you?
...
Spreadsheet Formulas
CellFormula
O2=SUMIFS($K$2:$K$12,$D$2:$D$12,M2,$I$2:$I$12,N2)
O3=SUMPRODUCT(--($D$2:$D$12=M2)*($I$2:$I$12=N2),K2:K12)

<tbody>
</tbody>

<tbody>
</tbody>

...
Ak

Your SumProduct formula is not well-formed...

It is:

Either...

=SUMPRODUCT(--($D$2:$D$12=M2),--($I$2:$I$12=N2),K2:K12)

Or...

=SUMPRODUCT(($D$2:$D$12=M2)*($I$2:$I$12=N2),K2:K12)

Or...

=SUMPRODUCT(($D$2:$D$12=M2)+0,($I$2:$I$12=N2)+0,K2:K12)

but not:

=SUMPRODUCT(--($D$2:$D$12=M2)*($I$2:$I$12=N2),K2:K12)
 
Upvote 0
Hi Aladin,

Thanks for the pointers, I use the -- and *, as that is the only "structure" I can remember!!
What is the main differences between the one I use and the alternatives you have provided, is it processing speed?

Thanks

Ak
 
Upvote 0
Hi Aladin,

Thanks for the pointers, I use the -- and *, as that is the only "structure" I can remember!!
What is the main differences between the one I use and the alternatives you have provided, is it processing speed?

Thanks

Ak

It's about consistency and coherency. It might even cause incorrectness.
 
Upvote 0

Forum statistics

Threads
1,226,812
Messages
6,193,125
Members
453,777
Latest member
Miceal Powell

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