Solved

Excel 2010 - Count common elements

Posted on 2011-09-22
6
246 Views
Last Modified: 2012-05-12
Dear Experts,

Can you please have a look at the attached file, it contains small data on Sheet1 and Sheet2, both in A column.

Could you advise which formula could give back a number that how many common elements are on the two sheets in column A? In the example this would be 3, because only the 101,102 and 107 are on both sheets

thanks,
CommonInColumn.xlsx
0
Comment
Question by:csehz
  • 3
  • 2
6 Comments
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
ID: 36579470
Hello,

try

=SUM(--(NOT(ISERROR(MATCH(A2:A7,Sheet1!A2:A5,0)))))

This is an Array formula and needs to be entered with Ctrl-Shift-Enter

Or a non-array formula, confirmed with a simple Enter

=SUMPRODUCT(--(NOT(ISERROR(MATCH(A2:A7,Sheet1!A2:A5,0)))))

cheers, teylyn
0
 
LVL 1

Author Comment

by:csehz
ID: 36579495
Teylyn thanks very much it works, can I put such array formula also to VBA?

thanks,
0
 
LVL 50

Expert Comment

by:teylyn
ID: 36579501
Possibly. But that would be a different question, since this one has been answered.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Closing Comment

by:csehz
ID: 36579508
Thanks :-)
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36579513
Can there be duplicates? For example if A6 became 102 there would still arguably be 3 common elements......but teylyn's formulas would return 4?

regards, barry
0
 
LVL 1

Author Comment

by:csehz
ID: 36579523
Barry well for me fortunately on the live files the columns sure do not have duplicates. So I even did not think to such scenario, however yes can be a good next question too :-)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now