ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditional sum of columns (https://www.excelbanter.com/excel-discussion-misc-queries/45507-conditional-sum-columns.html)

randys

Conditional sum of columns
 
If I have 1 row with 5 columns of data, how do I conditionally sum the
columns based on whether the column is greater than a value in another
separate cell? For example,

A B C D E
5 32 16 22 6 89
6
7 3


I only want to sum A5:E5 if the column is greater than the contents of A7.
In this example, the answer would be (6+89)=95. If A7=1, then the answer
would be (16+22+6+89)=133.


bj

=sumif(A1:E1,""&A7)

"randys" wrote:

If I have 1 row with 5 columns of data, how do I conditionally sum the
columns based on whether the column is greater than a value in another
separate cell? For example,

A B C D E
5 32 16 22 6 89
6
7 3


I only want to sum A5:E5 if the column is greater than the contents of A7.
In this example, the answer would be (6+89)=95. If A7=1, then the answer
would be (16+22+6+89)=133.


Domenic

Try...

=IF(A7<"",SUM(INDEX(A5:E5,A7+1):E5),"")

Note that the formula sums all columns when A7 equals 0.

Hope this helps!

In article ,
randys wrote:

If I have 1 row with 5 columns of data, how do I conditionally sum the
columns based on whether the column is greater than a value in another
separate cell? For example,

A B C D E
5 32 16 22 6 89
6
7 3


I only want to sum A5:E5 if the column is greater than the contents of A7.
In this example, the answer would be (6+89)=95. If A7=1, then the answer
would be (16+22+6+89)=133.



All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com