Countif match

joshbrfc

New Member
Joined
Jan 17, 2022
Messages
25
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I want to count the quantity of entries in a row on a specific tab in a workbook based on the match of someones name.

So this is the master data tab.

1707828289178.png


Then i have separate tabs.

And i want it to match with the name cell and the quantity of data entries.

1707828275512.png



Hope that makes sense.

Would Lookup be better?

So it updates automatically when another data entry is added.

Any help greatly appreciated. It's part of trying to improve right first time :) Want a tracker to focus on who needs training more and quick overview.
 

Attachments

  • 1707828159604.png
    1707828159604.png
    2.4 KB · Views: 8
  • 1707828179629.png
    1707828179629.png
    3.9 KB · Views: 8

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Would there be a separate sheet for each employee?
 
Upvote 0
Would there be a separate sheet for each employee?
All on the same workbook, but each employee has separate tabs, yes. I want a 'master data' tab where it's auto populating based off what is entered on each individual tab.
 
Upvote 0
All on the same workbook, but each employee has separate tabs, yes. I want a 'master data' tab where it's auto populating based off what is entered on each individual tab.
What do you want to count ? is it cell M8 in the pic. above?
 
Upvote 0
What do you want to count ? is it cell M8 in the pic. above?
It is the quantity of entries in the 'marker' column.

1707996377886.png


So it matches with the employee's name then pulls the quantity of entries in that column
 
Upvote 0
It is the quantity of entries in the 'marker' column.

View attachment 106911

So it matches with the employee's name then pulls the quantity of entries in that column
I don't know of any formula to match data across worksheets, but it can be done with a macro
try a User defined function like this:

Function CountEntries(Employee_Name As String)
Dim WS As Worksheet
Dim Entries As Long
For Each WS In ThisWorkbook.Worksheets
If Not WS.Name = ActiveSheet.Name Then
If WS.Range("B3") = "Employee" Then
If WS.Range("F3") = Employee_Name Then
CountEntries = Application.WorksheetFunction.CountA(WS.Range(WS.Range("B20"), WS.Range("b20").End(xlDown)))
Exit Function
End If
End If
End If
Next
End Function

click alt+f11 or go to developer tab and click on visual basic
in the visual basic window click on insert then choose moudle
copy the function above and paste in the moudle
then in the master data tab
next to the name in your example you have the first name in cell a2 and you want the number in cell B2
so in cell b2 type =CountEntries(a2)
 
Upvote 0
I don't know of any formula to match data across worksheets, but it can be done with a macro
try a User defined function like this:

Function CountEntries(Employee_Name As String)
Dim WS As Worksheet
Dim Entries As Long
For Each WS In ThisWorkbook.Worksheets
If Not WS.Name = ActiveSheet.Name Then
If WS.Range("B3") = "Employee" Then
If WS.Range("F3") = Employee_Name Then
CountEntries = Application.WorksheetFunction.CountA(WS.Range(WS.Range("B20"), WS.Range("b20").End(xlDown)))
Exit Function
End If
End If
End If
Next
End Function

click alt+f11 or go to developer tab and click on visual basic
in the visual basic window click on insert then choose moudle
copy the function above and paste in the moudle
then in the master data tab
next to the name in your example you have the first name in cell a2 and you want the number in cell B2
so in cell b2 type =CountEntries(a2)
I did try this before but got it wrong, so thankyou ever so much for your replies and for your effort! You sir, are a legend :)

So i've done it now

1707998885845.png


Based on

1707998955610.png


and
1707999052944.png


Am i being really slow but it's saying invalid name
 

Attachments

  • 1707999014980.png
    1707999014980.png
    10.7 KB · Views: 4
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,963
Members
449,094
Latest member
Anshu121

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