I'm trying to make a basic SUM of offsetted cells. Basically I have 4 columns, column A being just a title, column B being a counted number, and columns C and D referencing another value.
The thing I'm trying to accomplish is the number count on column G. It should be a SUM of all of the values in column B IF that number appears in the reference columns
An example would be that G2 would equal 15, since 1 appears in C2 (so it should add 7 from B2) and D3 (and add 8 from B3).
I have the basic =COUNTIF
function to count the instances, but how do I reference the value from column B if a value appears in column C or D?
=COUNTIF(C2:D4,"1")
=COUNTIF(C2:D4,"2")
...
https://docs.google.com/spreadsheets/d/1h9PDZii5wO866Hky3P_BZ_SOwuHAAd6qUySkuJ14L6A/edit?usp=sharing