Way to count values which are present in another list

Sourav Das

New Member
Joined
Jun 20, 2015
Messages
3
How do I count a list of Values only which are present in another List?

For example:

Value(to be counted)Value list
1210
112
6622
3344
987
22
12

<tbody>
</tbody>

 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,708
Office Version
  1. 2016
Platform
  1. Windows
Welcome to the forum, you should be able to use COUNTIF see example below:

Excel Workbook
ABC
1Value(to be counted)Value listCount
212100
31122
466221
533440
69870
7220
8120
Sheet1
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
1. control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(MATCH(A2:A8,B2:B6,0)),1))

2. Just enter:

=SUMPRODUCT((ISNUMBER(MATCH(A2:A8,B2:B6,0))+0)

3. Just enter:

=SUMPRODUCT(COUNTIFS(A2:A8,B2:B6))

The last one is the least efficient.
 

Sourav Das

New Member
Joined
Jun 20, 2015
Messages
3
Thanks a million Aladin bro. This works just fine. :)

I would request another additional feature to this. If the value is Greater than or equal to 22 or Cell no. B4, how would I count that in addition to the factors already taken under consideration.

1. control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(MATCH(A2:A8,B2:B6,0)),1))

2. Just enter:

=SUMPRODUCT((ISNUMBER(MATCH(A2:A8,B2:B6,0))+0)

3. Just enter:

=SUMPRODUCT(COUNTIFS(A2:A8,B2:B6))

The last one is the least efficient.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Thanks a million Aladin bro. This works just fine. :)

I would request another additional feature to this. If the value is Greater than or equal to 22 or Cell no. B4, how would I count that in addition to the factors already taken under consideration.

Do you mean...

=SUM(IF(ISNUMBER(MATCH(IF(A2:A8>=22,A2:A8),B2:B6,0)),1))

which must be confirmed with control+shift+enter, not just enter?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,784
Messages
5,833,682
Members
430,222
Latest member
Nickkarl

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
Top