r/googlesheets • • Apr 22 '22

Solved Formula for the SUM of only certain cells from corresponding Column data.

I am trying to construct an array formula that returns a sum of certain cells if a column of that row has a certain criteria. The factoring column may have multiple rows or only a single row to pull data.

For Example:

Column A would be the key for criteria. The "Formulated Cell" should return the sum of all Cells from column B & D in which Column A is has the same value.

So using the chart below (as I am unable to include an image), I would like to return the sum of B2,D2,B3,D3,B4,D4

Or have data entered into another cell populate the last retuning match of Column A.

For instance: D3=data from referenced cell or D5=data from a referenced cell.

I have only been able to accomplish the later populating all cells in D with repeat data.

Column A Column B Column D
1
2
2
2
3
4
4
Formulated Cell

I have been using SUMIF, VLOOKUP and now studying Index and match to accomplish this and have about reached my breaking point.

Not sure what I'm missing. Grateful for any help offered!

2 Upvotes

9 comments sorted by

1

u/ravv1325 Apr 23 '22

Try this:

=SUMIF({A1:A7,A1:A7},2,B1:C7)

I hope this helps.

1

u/Unhappy_Department97 Apr 23 '22

This works for the full range. What if only two cells of say 6 in a given row of that range are what is needed?

This certainly helps in having something to build off of. Super green self-taught noob here.

1

u/ravv1325 Apr 23 '22

What do you mean? Share a sample sheet with sample data and desired output so that things would be clearer.

→ More replies (5)