How to Add columns if a condition exists

S

swanley007

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...
 
P

Pete_UK

Put this in C1:

=SUMPRODUCT((A1:A100>0)*(B1:B100>0)*(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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top