I try to do a formulae which should check column A and if in cell value is 1 than formulae should take value in column B and sum with others which satisfy conditions
sheet example)) https://docs.google.com/spreadsheets/d/1hjP1-EgQYvKDOM6wYj_NmFiOXAsaAOAgaFGWf8feJxw/edit?usp=sharing
try:
=ARRAYFORMULA(QUERY({A2:A&""\ B2:B};
"select Col1,sum(Col2) where Col1 is not null
group by Col1 label sum(Col2)''"))