Looking for Array formula to count the records where two fields are equal

General Ledger

Active Member
Joined
Dec 31, 2007
Messages
460
Dear All,

I am looking for an array formula to return the number of times in a list of records that two fields within each record are equal.

For example: Column A is the field "Beginning". Column B is the field "Ending". On each line, either the values in columns A and B are equal or they are not equal. I need to count the number of records in the list where the values are equal.

Thanks,

GL
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Dear All,

I am looking for an array formula to return the number of times in a list of records that two fields within each record are equal.

For example: Column A is the field "Beginning". Column B is the field "Ending". On each line, either the values in columns A and B are equal or they are not equal. I need to count the number of records in the list where the values are equal.

Thanks,

GL

Either...

Control+shift+enter, not just enter:

=SUM(IF(A2:A100=B2:B100,1))

Or just enter:

=SUMPRODUCT((A2:A100=B2:B100)+0)
 
Upvote 0
Aladin,

You provided a great solution to the exact question I asked. Thanks so much.

VoG,

You answered the question I should have asked. Your formula considered that the number of records I was examining may not be known at the time the formula is created. Your solution is flexible enough to work on all the rows in an Excel sheet regardless of the range of records and ignores blank rows.

You guys really rock!

Thanks,

GL
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top