Google Sheets Formulas – How to Run Formula Checking Multiple Cells

formulasgoogle sheets

I want to run a formula that checks each cell between say F2 and F8, and if they match the relative cell in column B, it adds those cells together, and outputs in cell F9.

Example expected result:

|B2 - 5 |  |F2 - 10|
|B3 - 6 |  |F3 - 6 |- Match
|B4 - 9 |  |F4 - 9 |- Match
|B5 - 12|  |F5 - 15|
|B6 - 2 |  |F6 - 2 |- Match
|B7 - 14|  |F7 - 14|- Match
|B8 - 1 |  |F8 - 7 |
|B9 -   |  |F9 - 31|- Output Cell

Edit: I left the part out where I ask if this is even possible. Silly me. So yeah, is this sort of formula possible on Google Sheets, or am I better off trying something else?

Best Answer

The formula you would use is:

=ArrayFormula(SUM(IF($B2:$B27=K2:K27,$B2:$B27,"")))

Functions used: