ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to Add columns if a condition exists (https://www.excelbanter.com/excel-discussion-misc-queries/186147-how-add-columns-if-condition-exists.html)

swanley007

How to Add columns if a condition exists
 
Hello;

I have a set of data lets say column A,B,C rows 1-?. I want to make a cell
where if A:X and B:X are both 0 add the number in A:X to a total. If B:X or
A:X are either not 0 then do not add. I would like to go through both
colums row by row and get a total to display in one cell. Any help would be
great. Also, A:X simply means Column A row X (whatever) whre the row for A
and B are the same. I would like to display the total in C:1. NOTE to avoid
confusion when comparing colums A and B, the row will be the sane and then to
the next row and so on...

Pete_UK

How to Add columns if a condition exists
 
Put this in C1:

=SUMPRODUCT((A1:A1000)*(B1:B1000)*(A1:A100)*(B1: B100))

I've assumed you have 100 rows - adjust ranges to suit your data, but
you cannot use full-column references in Excel versions prior to 2007.

Hope this helps.

Pete

On May 5, 4:22*am, swanley007
wrote:
Hello;

I have a set of data lets say column A,B,C rows 1-?. *I want to make a cell
where if A:X and B:X are both 0 add the number in A:X to a total. *If B:X or
A:X are either not 0 then do not add. *I would like to go through both
colums row by row and get a total to display in one cell. *Any help would be
great. *Also, A:X simply means Column A row X (whatever) whre the row for A
and B are the same. *I would like to display the total in C:1. *NOTE to avoid
confusion when comparing colums A and B, the row will be the sane and then to
the next row and so on...




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

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