# How do I find the sum of a specific row of values, but only for columns that contain a different specific value?

My sheet looks something like this:

I'm trying to create a formula for the Total profit column, which would be the sum of the winnings/losses for that person for that row. So for instance, for `Person1`, the value would be `-41.15`, (i.e. -`70 + 13.05 +15.8`).

My approach was something like this: Get the columns that have at least one cell that has the exact value "Winnings/Losses". From those columns, sum over the values from the row that corresponds to the current person.

I've been trying to use formulas like `FILTER`, `ARRAYFORMULA`, `VLOOKUP`, etc, to no avail, I just can't seem to get them to do what I want. I've found the sheet formulas to be non-intuitive. probably because I come from an imperative programming background (C, Python, Typescript, etc). Any help is appreciated.

• What is wrong with `=E1+H1+J1`? Commented Feb 13, 2020 at 7:44
• I am going to have a very large number of the three-column sections, such that manually entering their column/row addresses would be come cumbersome and error-prone Commented Feb 13, 2020 at 15:31
• "I am going to have a very large number of the three-column sections" All we can do is answer your question based on the information that you supply. There's no mention of a very large number of the three-column sections; if that is a critical issue, then please edit your question accordingly. You might also want to quantify "a very large number" - this means all things to all people. Commented Feb 13, 2020 at 23:13

You can try `=sumif()`
``````=SUMIF(\$B\$1:\$E\$1,"B",B2:E2)
You just need to replace `B` with `Winning/Losses` or whatever you need.