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.

link|improve this question
feedback

2 Answers

up vote 4 down vote accepted

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)))

link|improve this answer
Works perfectly. Thanks. – Chris Marasti-Georg Jan 1 at 17:39
feedback

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)
link|improve this answer
Looks good. If no one posts a one-cell answer I'll accept. – Chris Marasti-Georg Jan 1 at 17:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.