+ Reply to Thread
Results 1 to 8 of 8

Countifs with index match

  1. #1
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    26

    Countifs with index match

    Hi Struggling to even think about the logic for this one.

    I have two worksheets:

    Worksheet 1 named: “Matter Spend ALL”
    Worksheet 2 named: “RM Report Data”

    There is one unique field that links the two worksheets named: “Short Matter Name” which sits in column B on both worksheets. When I say unique, the matter names will be the same (same spelling and same format) in both worksheets but worksheet 2 may contain a number of duplicate entries.

    I need to find a formula that does the following:
    1) For worksheet 1 it finds each “Short Matter Name” where the matter is “Open”. The open status is in column “K” in Worksheet 1 (“Matter Spend ALL”).
    2) Uses the outputs from 1) to count the matters in Worksheet 2 (“RM Report Data”) where the following is also true:
    a. The Practice Group (column Q in Worksheet 2("RM Report Data") matches the practice group in A2 to A8 in the table below.
    b. The PO number (column M in worksheet 2 (“RM Report Data”)) has an irregularity i.e. it either is states “awaited”, “tbc”, “TBC”, “?” or is blank.
    c. The formulae should then sum the volume of irregularities found for each Practice Group in column B in the table below.

    I have created formulas below in B2 and C2 of the table below. The ranking formulae works but the formulae in column B produces the wrong results. I think this is because I need an index/match in there somewhere.

    Unfortunately, a pivot table is not a solution to this nor is power BI as my stakeholders don’t have this.

    Any help would be greatly appreciated.

    P
    SNIPJAN2019.PNG

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    29,244

    Re: Countifs with index match

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    26

    Re: Countifs with index match

    I have uploaded a sample file as requested. The column numbers in my original post have therefore changed but I have included a detailed explanation of the desired result in the attached. Thanks for your help so far.

    Paul
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    26

    Re: Countifs with index match

    Hi All / Administrator - I am assuming there is no solution to this - should I just close the post or is there any further information I could provide to help?

    Regards

    P

  5. #5
    Forum Moderator
    Join Date
    05-14-2009
    Location
    RDC
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    7,230

    Re: Countifs with index match

    To me the explanation from post #1 seems difficult to understand.
    Could you please adapt it in function of the sheets in the wbk you uploaded? (For example "Matter Spend All is the second sheet in your example and the status is in col B ,not K as decribed
    ( hope it's not too much trouble)

  6. #6
    Forum Moderator
    Join Date
    05-14-2009
    Location
    RDC
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    7,230

    Re: Countifs with index match

    And BTW, if you don't get an answer within say 24 hrs, do not hesitate to "bump" your thread.

  7. #7
    Valued Forum Contributor Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    BKK, Thailand
    MS-Off Ver
    Excel365
    Posts
    2,502

    Re: Countifs with index match

    Please try at Ranking New D2 Press Ctrl+Shift+Enter and drag down

    =SUM(COUNTIFS('RM Report Data'!C:C,A2,'RM Report Data'!B:B,{"*",0,""},'RM Report Data'!A:A,IF(('Matter Spend All'!$C$2:$C$16=A2)*('Matter Spend All'!$B$2:$B$16="Open"),'Matter Spend All'!$A$2:$A$16)))

    Business Spend>SA Count 1 because
    Matter Spend All row#9 Gringot 67543 > Open and
    RM Report Data row#10 Gringot 67543 has no PO number.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-01-2016
    Location
    England
    MS-Off Ver
    2016
    Posts
    26

    Re: Countifs with index match

    Bo_Ry - Your solution works like a treat - thank you so much and apologies for the Gringot miscalculation!.

    Thank you so much

    P

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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