Summing totals for corresponding random generated numbers

hanzsolo

New Member
Joined
Aug 5, 2011
Messages
13
I'm generating a random integer in column A (product) between 1 and 20 and another random integer in column B (quantity) between 1 and 100.

I want to record the total quantity for each product in column C. How do I do this?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
So, do you just want to add the numbers in columns A and B and report the total in column C for each row?

If so, then it should be as simple as a formula like this is C1:
=A1 + B1
 
Upvote 0
No, I have a list of 30 rows of randomly generated Products in column A. I want to automatically total each products randomly generated quantity (col b) in column C.

A B C D
1 10 1 20
2 50 2 50
1 10 3 0
5 20 4 0
7 50 5 20

C2 is product 1
D2 is the total number of product 1 (B2+B4) =10+10=20

I would like to automatically populate the fields instead of manually adding the numbers
 
Upvote 0
Use SUMIF. Place this formula in D2 and copy down for all rows:
=SUMIF(A$2:A$6,C2,B$2:B$6)

Obviously, you will need to adjust your formula to account for the total number of rows you have.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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