ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula (https://www.excelbanter.com/excel-discussion-misc-queries/145160-formula.html)

HIRAN

Formula
 
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

Barb Reinhardt

Formula
 
Try something like this:

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

Activate with CTRL SHIFT ENTER

HTH,
Barb Reinhardt


"HIRAN" wrote:

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


Roger Govier

Formula
 
Hi Barb

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

--
Regards

Roger Govier


"Barb Reinhardt" wrote in
message ...
Try something like this:

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

Activate with CTRL SHIFT ENTER

HTH,
Barb Reinhardt


"HIRAN" wrote:

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




HIRAN

Formula
 
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

"Barb Reinhardt" wrote:

Try something like this:

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

Activate with CTRL SHIFT ENTER

HTH,
Barb Reinhardt


"HIRAN" wrote:

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



All times are GMT +1. The time now is 12:05 AM.

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