Formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Can you please help me with this problem, I have 2 Columns, with 5 Rows each
or any amount of rows, for example Column A contains the following numbers
1,2,3,8,3 and column B Contains 0,2,9,4,3. What I want to do is Compare both
columns and if the rows match (row number 2 and 5 in this example), I want
the numbers added. so in this example since row number 2 and 5 match, i want
them added which in this case would equal 5.

Thanks
 
Try something like this:

=SUMPRODUCT(--(A1:A5=B1:B5),(A1:A5))

Activate with CTRL SHIFT ENTER

HTH,
Barb Reinhardt
 
Hi Barb

Just a quick "heads up" - The Sumproduct formula does not need to be
array entered. Just Enter will do.
 
Hi Barb,

Thank you for the solution, it worked great. I have one other issue and
wondering if you might be able to help me, what if I want to accomplish a
similar task but instead of matching similar numbers in the two columns, I
want to see if there is anything in the two columns. For example 2 Columns,
with 5 Rows each, Column A contains the following numbers 1, , , ,3 and
column B Contains 1,2,3,4,5. What I want to do is Compare both columns and if
the rows contain any numbers (row number 1, and 5 in this example), I want
the column A numbers to be added so in this example since row number 1 and 5
match, I want them added which in this case would equal 4. Thanks again for
your help and I really appreciate it.

Hiran
 
Thank you for the solution, it worked great. I have one other issue and
wondering if you might be able to help me, what if I want to accomplish a
similar task but instead of matching similar numbers in the two columns, I
want to see if there is anything in the two columns. For example 2 Columns,
with 5 Rows each, Column A contains the following numbers 1, , , ,3 and
column B Contains 1,2,3,4,5. What I want to do is Compare both columns and if
the rows contain any numbers (row number 1, and 5 in this example), I want
the column A numbers to be added so in this example since row number 1 and 5
match, I want them added which in this case would equal 4. Thanks again for
your help and I really appreciate it.

-Hiran
 

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

Back
Top