vba - sumif, vlookup usage together -
i think having mental block afternoon.
i have sheet - sheet acts table codes. column b in both sheets detailed description dont need, second table may have few rows or hundreds, example. second sheet subset of first , removing granularity adding column c sum them up.
column a(unique code) b c 1 abd wood 2 rkger wood 3a egje concrete 4 kepog metal 5 kepog metal
2nd sheet
column b c 1 abd 4.5 2 rkger 5.5 3a egje 5 4 kepog 3
basically want return
wood 10 concrete 5 metal 3
i think need sumif , vlookup
using example data provided (you can modify rows needs).
in column d of sheet2, put formula:
=vlookup(b2,sheet1!$b$2:$c$6,2,false)
after, in order not have separate sheet, add in bottom total section following formula:
=sumif($d$2:$d$5,d8,$c$2:$c$5)
see image below:
Comments
Post a Comment