Let A1:B6 on Sheet1 house the sample provided, including labels:
{"Item","Amount";"34-f-r",33;"34-f-r",56;"34-f-k",44;"34-f-t",99;"34-f-t",82}
Thus: A1 is Item, B1 Amount, A2 34-f-r, etc.
On Sheet1...
C1: 0
which is mandatory.
C2, copied down:
=IF((A2<"")*ISNA(MATCH(A2,$A$1:A1,0)),LOOKUP(9.99 999999999999E+307,$C$1:C1)+1,"")
On Sheet2...
A1:
=LOOKUP(9.99999999999999E+307,Sheet1!$C$1:$C$6)
A2: Item
A3, copied down:
=IF(ROW()-ROW($A$3)+1<=$A$1,LOOKUP(ROW()-ROW($A$3)+1,Sheet1!$C$2:$C$6,Sheet1!$A$2:$A$6),"")
which yields a no-blanks list of distinct items.
B2: Total Amount
B3, copied down:
=IF(A3<"",SUMIF(Sheet1!$A$2:$A$6,A3,Sheet1!$B$2:$ B$6),"")
which yields the desired subtotals per distinct item.
Mosqui wrote:
I'm not sure how to do this.
A B
34-f-r 33
34-f-r 56
34-f-k 44
34-f-t 99
34-f-t 82
I want to add column B if A is the same, so I want to make anothe sheet with
cells in column A no repeated but all the values in column B added.
A B
34-f-r 89
34-f-k 44
34-f-t 181
Thanks and congratulations to all the helpers.
Martin
|