ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to SUM on a condition? (https://www.excelbanter.com/excel-worksheet-functions/226388-how-sum-condition.html)

trant

How to SUM on a condition?
 
I have two columns A & B which are filled with x rows of numbers.

I have a cell C1 where I show a Total which should basically SUM up the
values in the two columns but there's one special conidtion:

if the value in column A is 0, I only want the sum to use that value,
otherwise use the value in column B.

How can I do this using just excel functions?

Luke M

How to SUM on a condition?
 
=SUM(A:A)+SUMIF(A:A,"<0",B:B)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"trant" wrote:

I have two columns A & B which are filled with x rows of numbers.

I have a cell C1 where I show a Total which should basically SUM up the
values in the two columns but there's one special conidtion:

if the value in column A is 0, I only want the sum to use that value,
otherwise use the value in column B.

How can I do this using just excel functions?


Ashish Mathur[_2_]

How to SUM on a condition?
 
Hi,

You simply have to sum column B I.e. =sum(B3:B50)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"trant" wrote in message
...
I have two columns A & B which are filled with x rows of numbers.

I have a cell C1 where I show a Total which should basically SUM up the
values in the two columns but there's one special conidtion:

if the value in column A is 0, I only want the sum to use that value,
otherwise use the value in column B.

How can I do this using just excel functions?




All times are GMT +1. The time now is 02:57 PM.

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