Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default =sum(if(a1=b1,1,0),if(a2=b2,1,0),if(a3=b3,1,0),... ..)

I have 2 columns
A B
1 a a
2 d d
3 c a
I want to know how many lines A=B -this must be an numerical value -in this
case 2
=sum(if(a1=b1,1,0),if(a2=b2,1,0),if(a3=b3,1,0),... ..) is a solution
But simply is more usefully :D
Anyone can help me pls?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default =sum(if(a1=b1,1,0),if(a2=b2,1,0),if(a3=b3,1,0),... ..)

Try this array* formula:

=SUM(IF(A1:A10=B1:B10,1,0))

Change the ranges to suit.

* An array fromula has to be committed using <CTRL<SHIFT<ENTER
(CSE) instead of the usual <ENTER. If you do this correctly then
Excel will wrap curly braces { } around the formula when viewed in the
formula bar - you must not type these yourself. If you amend the
formula, then use CSE again to commit it.

Hope this helps.

Pete

On Apr 16, 12:52*pm, Farkas Attila <Farkas
wrote:
I have 2 columns
* * A * B
1 *a * a
2 *d * d
3 *c * a
I want to know how many lines A=B -this must be an numerical value -in this
case 2
=sum(if(a1=b1,1,0),if(a2=b2,1,0),if(a3=b3,1,0),... ..) is a solution
But simply is more usefully :D
Anyone can help me pls?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default =sum(if(a1=b1,1,0),if(a2=b2,1,0),if(a3=b3,1,0),... ..)

Hi,

Change the range to suit

=SUMPRODUCT((A1:A20"")*(A1:A20=B1:B20))

Mike

"Farkas Attila" wrote:

I have 2 columns
A B
1 a a
2 d d
3 c a
I want to know how many lines A=B -this must be an numerical value -in this
case 2
=sum(if(a1=b1,1,0),if(a2=b2,1,0),if(a3=b3,1,0),... ..) is a solution
But simply is more usefully :D
Anyone can help me pls?

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 03:32 AM.

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

About Us

"It's about Microsoft Excel"