Home > Software design >  How do I sum all the columns with the same header into one column in excel?
How do I sum all the columns with the same header into one column in excel?

Time:11-29

I am using a football dataset where I have changed all the countries to specific geographical areas in their column headers. What I want to do is I want to add up all the columns with the same geographic value with all the values added up.

This is how my data looks like:

Excel sheet of data

The value of #players should still remain the same after condensing the data. I tried using the data function, but I could not figure it out.

My output should ideally look like a column with all the EUs added up, the AFRs added up etc.

CodePudding user response:

It's actually unclear as to exactly what it is you're trying to do.
Here is an example use of SUMIF that addresses one possible interpretation:

=SUMIF($B$1:$E$1,F$1,$B2:$E2)

And here is an image showing how and were that formula would be used in this sample table: enter image description here

If this doesn't address what you're aimed for, could you make an effort to do as I have done and show a small sample with the expected results.

CodePudding user response:

I was able to solve it using the SUM function.

I used SUM(C2,C6,C7....) every column that had an EU in it and did the same for the other headers.

  • Related