A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
For a solution using formula(s), refer below image:
Formula in cell H3 to be copied down:
=IFERROR(IFERROR(INDEX(B$3:B$20, MATCH(0,INDEX(COUNTIF(H$2:H2,B$3:B$20)+(B$3:B$20=""),), 0)),INDEX(E$3:E$20, MATCH(0,INDEX(COUNTIF(H$2:H2,E$3:E$20)+(E$3:E$20=""),), 0))), "")
For values, 2 options:
Option 1: Enter below formula in cell I3 and copy down:
=IF(H3="","",SUMIF(B$3:B$20,H3,C$3:C$20)+SUMIF(E$3:E$20,H3,F$3:F$20))
Option 2: Enter below formula in cell J3 and copy down:
=IF(H3="","",SUM(SUMIF(OFFSET(B$3,{0;0},{0;3},{6;9}),H3,OFFSET(C$3,{0;0},{0;3},{6;9}))))
Regards
Amit Tandon