MS Excel - Help with Formula

SHL

Executive Member
Joined
Dec 17, 2012
Messages
6,175
Reaction score
11,223
Hi. Need help with a formula for the last column that sums total quantity sold per product per store. I want to enter the formula in D3 and just drag/copy it down.

StoreProductQty SoldWhich formula can help sum as below?
B11
104046350​
1​
2​
B11
104046350​
1​
2​
B11
104049971​
1​
3​
B11
104049971​
1​
3​
B11
104049971​
1​
3​
B11
104046260​
1​
2​
B11
104046260​
1​
2​
B11
104045651​
1​
3​
B11
104045651​
1​
3​
B11
104045651​
1​
3​
C12
108017391​
1​
1​
C12
104046112​
1​
1​
C12
104049971​
1​
2​
C12
104049971​
1​
2​
C12
104046260​
1​
2​
C12
104046260​
1​
2​
C12
104046165​
1​
2​
C12
104046165​
1​
2​
E17
108017391​
1​
1​
E17
104046350​
1​
1​
E17
104049971​
1​
1​
E17
104046093​
1​
3​
E17
104046093​
1​
3​
E17
104046093​
1​
3​
E17
104050260​
1​
1​
E17
104046260​
1​
2​
E17
104046260​
1​
2​
E17
104046165​
1​
1​
E17
104045651​
1​
2​
E17
104045651​
1​
2​
 
Hi. Need help with a formula for the last column that sums total quantity sold per product per store. I want to enter the formula in D3 and just drag/copy it down.

StoreProductQty SoldWhich formula can help sum as below?
B11
104046350​
1​
2​
B11
104046350​
1​
2​
B11
104049971​
1​
3​
B11
104049971​
1​
3​
B11
104049971​
1​
3​
B11
104046260​
1​
2​
B11
104046260​
1​
2​
B11
104045651​
1​
3​
B11
104045651​
1​
3​
B11
104045651​
1​
3​
C12
108017391​
1​
1​
C12
104046112​
1​
1​
C12
104049971​
1​
2​
C12
104049971​
1​
2​
C12
104046260​
1​
2​
C12
104046260​
1​
2​
C12
104046165​
1​
2​
C12
104046165​
1​
2​
E17
108017391​
1​
1​
E17
104046350​
1​
1​
E17
104049971​
1​
1​
E17
104046093​
1​
3​
E17
104046093​
1​
3​
E17
104046093​
1​
3​
E17
104050260​
1​
1​
E17
104046260​
1​
2​
E17
104046260​
1​
2​
E17
104046165​
1​
1​
E17
104045651​
1​
2​
E17
104045651​
1​
2​
Personally, I'd just use a pivot table... not exactly what you asked for but it's the easiest method I can think of.
 
I think the simplest case with a formula is a "sumif".
 
If Store is in Column A, and Product is in Column B, and Quantity is in Column C, then the formula:

Code:
=SUMIFS(C:C, B:B, B2, A:A, A2)

where 2 is the row that you're entering the formula into. i.e. if the first entry starts on row 3 or 4, use that instead of 2.

20210604a.png
 
Alternatively, as Messugga said, PivotTables were made for this, and they're an amazingly useful tool to figure out if you work with Excel a lot.

Four easy steps:

  1. Click on one of the cells with data on your sheet
  2. Insert tab on the top of your screen, then PivotTable button (usually the first button)
  3. It should pop up a dialog box titled "Create PivotTable" with lots of options. For now you can ignore them all. Just make sure that on the sheet, the selection is around all your rows and columns. Press OK
  4. On this new sheet, you'll see something on the left saying "To build a report...", and on the right, a new panel with your columns in a list on the top, and 4 boxes at the bottom. Just click the tickboxes next to Store, Product and Qty Sold, and Excel will should figure out which boxes to put them in automatically.

20210604b.png
 
Personally, I'd just use a pivot table... not exactly what you asked for but it's the easiest method I can think of.

If Store is in Column A, and Product is in Column B, and Quantity is in Column C, then the formula:

Code:
=SUMIFS(C:C, B:B, B2, A:A, A2)

where 2 is the row that you're entering the formula into. i.e. if the first entry starts on row 3 or 4, use that instead of 2.

View attachment 1082909

Alternatively, as Messugga said, PivotTables were made for this, and they're an amazingly useful tool to figure out if you work with Excel a lot.

Four easy steps:

  1. Click on one of the cells with data on your sheet
  2. Insert tab on the top of your screen, then PivotTable button (usually the first button)
  3. It should pop up a dialog box titled "Create PivotTable" with lots of options. For now you can ignore them all. Just make sure that on the sheet, the selection is around all your rows and columns. Press OK
  4. On this new sheet, you'll see something on the left saying "To build a report...", and on the right, a new panel with your columns in a list on the top, and 4 boxes at the bottom. Just click the tickboxes next to Store, Product and Qty Sold, and Excel will should figure out which boxes to put them in automatically.

View attachment 1082917
Thanks a mil. Appreciated :thumbsup:
 
Top
Sign up to the MyBroadband newsletter
X