One way ..
In Sheet1
------------
Assume data below is in A2:B6
Paint 30
Thinner 15
Paint 10
Thinner 5
Caulk 0
etc
Put in say, D1:
=IF(OR(COUNTIF($A$2:A2,A2)1,B2=0),"",ROW())
Copy down by as many rows as data is expected
in cols A and B, say down to D100
In Sheet2
-------------
Select A2:A100
(# of rows similar to col D in Sheet1)
Put in the formula bar:
=IF(ISERROR(MATCH(SMALL(Sheet1!D:D,ROW(A1:A100)),S heet1!D:D,0)),"",INDEX(She
et1!A:A,MATCH(SMALL(Sheet1!D:D,ROW(A1:A100)),Sheet 1!D:D,0)))
Array-enter the formula with CTRL+SHIFT+ENTER
instead of just pressing ENTER
Put in B2:
=IF(A2="","",SUMIF(Sheet1!A:A,A2,Sheet1!B:B))
Copy down to B100
You'll get the desired results
(for the sample data)
Paint 40
Thinner 20
<Rest are blanks
Adapt to suit
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"lintan" wrote in message
...
Column A contains material name and Column B contains usage. I would like
to
choose the name and the total usage of materials that were used. For
explanation purposes,
Column A Column B
Paint 30
Thinner 15
Paint 10
Thinner 5
Caulk 0
Therefore, the table will contain paint = 40 and thinner = 20. Caulk will
not be displayed since it had zero usage.
|