Combine Match and Countif for strings and numbers?

elution91

New Member
Joined
Mar 23, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. MacOS
Hello,

I am in need of a formula, which I think may be quite straightforward however, I cannot get the result I want.

In sheet 1, column B I have a list of strings, they are also located in column B in sheet 2.

In sheet 1, column G, each string has an associated number in date format 01/01/2010. Only the year is of interest.
Date values can go on for multiple rows in column G in Sheet 1, such that there are can be empty rows between the strings in Column B. In Column L in Sheet 2, I want for each string name, the number of occurrences of each specified year, such that the number 3 would be returned in the below example for 2010.



Example:
Sheet 1
Column B Column G

Name1 10/01/2010
19/20/2010
01/01/2010
Name2 .........

I have tried the following formula as a start, it is not quite working though, it correctly returns 1 for strings that had a 2010, but not multiple 2010's.

=COUNTIF(INDEX(Sheet1!G:G;MATCH(B2;Sheet1!B:B;));"*"&2010&"*")

Thank you!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,877
Messages
6,122,051
Members
449,064
Latest member
scottdog129

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