+ Reply to Thread
Results 1 to 6 of 6

Formula to count how many cells contains a name & within that month

  1. #1
    Forum Contributor
    Join Date
    02-12-2018
    Location
    Clearwater, FL
    MS-Off Ver
    MS 365
    Posts
    214

    Formula to count how many cells contains a name & within that month

    I have a chart with peoples name & across the top the months. On another sheet I have a list of files that follow this name format: Name_mm-dd-yyyy_Case #000000.PDF.

    Is there a formula that I can look through that list of files & count how many each person has and place in the correct column based on which month it is for? I have added screenshots to help visualize what I would like. The 1st image is the list of Files & the 2nd image is the results which I need to show. I have also attached an example of my workbook.

    List of Files.JPGResults.JPG

    Thank you for your help in advance!
    Attached Files Attached Files
    Last edited by Jamesraywebber85; 04-11-2023 at 01:40 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,863

    Re: Formula to count how many cells contains a name & within that month

    You can use this formula in cell P2 of Sheet1:

    =COUNTIFS(Sheet2!$A:$A,$O2&"*",Sheet2!$A:$A,"*"&MONTH(P$1)&"*"&YEAR(P$1)&"*")

    then copy across and down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Formula to count how many cells contains a name & within that month

    In B3 >> =LEFT(A3,FIND("_",A3)-1)
    In C3 >> =LEFT(MID(A3,FIND("_",A3)+1,LEN(A3)),FIND("_",MID(A3,FIND("_",A3)+1,LEN(A3)))-1)+0
    In D4 >> =MID(A3,FIND("Case",A3),LEN(A3))

    Now on your table in P2 >> =SUMPRODUCT(--(MONTH(P$1)=MONTH(Sheet2!$C$3:$C$19)),--(Sheet1!$O2=Sheet2!$B$3:$B$19))
    HTH
    Regards, Jeff

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,863

    Re: Formula to count how many cells contains a name & within that month

    Sorry, slight amendment needed, as follows:

    =COUNTIFS(Sheet2!$A:$A,$O2&"*",Sheet2!$A:$A,"*"&MONTH(P$1)&"????"&YEAR(P$1)&"*")

    Hope this helps.

    Pete

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Formula to count how many cells contains a name & within that month

    I'm guessing Pete's method is much neater.

  6. #6
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,802

    Re: Formula to count how many cells contains a name & within that month

    Sheet2
    copy and paste the strings in A3:A19 as values

    In the ribbon click on data and click on Text to columns

    Select Delimited

    Next

    Select other and in the box put _ as a delimiter

    Next

    Destination A3

    Finish

    Sheet1

    P2=SUMPRODUCT((Sheet2!$A$3:$A$19=Sheet1!$O2)*(MONTH(Sheet2!$B$3:$B$19)=MONTH(P$1)))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 01-11-2023, 05:16 PM
  2. [SOLVED] how to count cells with values but ignore blank cells with formula and in a month?
    By Imran Magsi in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-17-2017, 03:58 AM
  3. How do I count non blank cells each month??
    By clearbluesky in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2014, 06:21 AM
  4. Count number of cells in column per month, ignore blank cells
    By lamdl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-13-2014, 08:50 PM
  5. Count Cells that Fall within a Certain Month
    By joeshamokin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2013, 04:21 PM
  6. sumproduct formula to count keyword in cells for a given month
    By philllipoosis in forum Excel General
    Replies: 1
    Last Post: 01-13-2011, 02:28 PM
  7. Count Cells if they Contain a Month
    By cjconnor24 in forum Excel General
    Replies: 12
    Last Post: 02-10-2009, 10:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1