Total Values of Products in a list

pinkpanther6666

Board Regular
Joined
Feb 13, 2008
Messages
193
Office Version
  1. 365
Platform
  1. Windows
Good Evening All,

On Sheet 1 In column A and Column B i have the following List

Apples 12
Banana 10
Oranges 23
Pears 9
Apples 21
Oranges 19


On Sheet 2 i want to list the totals for each product where ?? is the total of that product on Sheet 1

Apples ??
Banana ??
Oranges ??
Pears ??


Can anyone help me out please

Many Thanks


Steve
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
ONe solution is use Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Total", each List.Sum([Column2]), type nullable number}})
in
    #"Grouped Rows"

Book2
ABCDE
1Column1Column2Column1Total
2Apples12Apples33
3Banana10Banana10
4Oranges23Oranges42
5Pears9Pears9
6Apples21
7Oranges19
Sheet1
 
Upvote 0
Alansidman

Many thanks for your quick reply

I will have a look at this

Many Thanks

Steve
 
Upvote 0
Do you already have the unique names on the 2nd sheet?

Book3 (version 1).xlsb
ABCDE
1Apples12Apples33
2Banana10Banana10
3Oranges23Oranges42
4Pears9Pears9
5Apples21
6Oranges19
Sheet3
Cell Formulas
RangeFormula
E1:E4E1=SUMPRODUCT((D1=$A$1:$A$6)*$B$1:$B$6)


(what version of Excel do you run?)
 
Upvote 0
Solution
KWeaver

That worked a treat thanks

Yes i have a list of the Products on Sheet 2

Im Using Excel 365 if that helps

Thanks in advance


Steve
 
Upvote 0
With 365 you can make the list on Sheet2 unique values from Sheet1 using =UNIQUE(Sheet1!range)

Book3
AB
1Apples33
2Banana10
3Oranges42
4Pears9
Sheet2
Cell Formulas
RangeFormula
A1:A4A1=UNIQUE(Sheet1!A1:A6)
B1:B4B1=SUMPRODUCT((A1=Sheet1!$A$1:$A$6)*(Sheet1!$B$1:$B$6))
Dynamic array formulas.
 
Upvote 0
If you have the 'Let' function...

Book1 (version 2).xlsb
ABCDE
1Apples12Apples33
2Banana10Banana10
3Oranges23Oranges42
4Pears9Pears9
5Apples21Total:94
6Oranges19
Sheet16
Cell Formulas
RangeFormula
D1:E5D1=LET(a,A1:A6,b,B1:B6,u,UNIQUE(a),s,SUMIF(a,u,b),c,CHOOSE({1,2},u,s),IFERROR(INDEX(c,SEQUENCE(ROWS(u)+1),{1,2}),CHOOSE({1,2},"Total:",SUM(s))))
Dynamic array formulas.
 
Upvote 0
Hi,

Am I missing something?
Why can't we just use SUMIF?

Book1
AB
1Apples12
2Banana10
3Oranges23
4Pears9
5Apples21
6Oranges19
7
8
9
10
Sheet1


Book1
AB
1Apples33
2Banana10
3Oranges42
4Pears9
Sheet2
Cell Formulas
RangeFormula
B1:B4B1=SUMIF(Sheet1!A$1:A$10,A1,Sheet1!B$1:B$10)
 
Upvote 0
If you have the 'Let' function...

Book1 (version 2).xlsb
ABCDE
1Apples12Apples33
2Banana10Banana10
3Oranges23Oranges42
4Pears9Pears9
5Apples21Total:94
6Oranges19
Sheet16
Cell Formulas
RangeFormula
D1:E5D1=LET(a,A1:A6,b,B1:B6,u,UNIQUE(a),s,SUMIF(a,u,b),c,CHOOSE({1,2},u,s),IFERROR(INDEX(c,SEQUENCE(ROWS(u)+1),{1,2}),CHOOSE({1,2},"Total:",SUM(s))))
Dynamic array formulas.
I did.

=LET(a,A1:A6,b,B1:B6,u,UNIQUE(a),s,SUMIF(a,u,b),c,CHOOSE({1,2},u,s),IFERROR(INDEX(c,SEQUENCE(ROWS(u)+1),{1,2}),CHOOSE({1,2},"Total:",SUM(s))))
 
Upvote 0

Forum statistics

Threads
1,215,548
Messages
6,125,472
Members
449,231
Latest member
Sham Yousaf

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