#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"