How do I calculate the sum of 2 columns, using the max from each row?

4

1

I have data in two columns. I would like the sum of the two columns, using the maximum value for each row.

For instance

C1  C2
 1   2
 4   3
11      
    10
 5   7

The result would be 2+4+11+10+7.

I would prefer if the solution worked in Google Spreadsheets, but if that can't happen Excel would be ok.

Chris Marasti-Georg

Posted 2012-01-01T17:00:27.857

Reputation: 151

Answers

7

For a one cell solution you can use an "array formula" like this in excel

=SUM(IF(A2:A6>B2:B6,A2:A6,B2:B6))

confirmed with CTRL+SHIFT+ENTER

In google docs you should be able to do the same - either use CTRL+SHIFT+ENTER with the above or use

=ARRAYFORMULA(SUM(IF(A2:A6>B2:B6,A2:A6,B2:B6)))

barry houdini

Posted 2012-01-01T17:00:27.857

Reputation: 10 434

1

Is this too simple?

C1  |C2   |C3
1   |2    |=MAX(A2,B2)
4   |3    |=MAX(A3,B3)
11  |     |=MAX(A4,B4)
    |10   |=MAX(A5,B5)
5   |7    |=MAX(A6,B6)
    |     |=SUM(C2:C6)

Tony Dallimore

Posted 2012-01-01T17:00:27.857

Reputation: 696

Looks good. If no one posts a one-cell answer I'll accept. – Chris Marasti-Georg – 2012-01-01T17:22:20.797