+ Reply to Thread
Results 1 to 7 of 7

COUNTIF with unknowns

  1. #1
    Registered User
    Join Date
    01-05-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    43

    COUNTIF with unknowns

    Hi everyone!

    This one is a bit complicated so I hope you can bear with me.

    I've recently learnt that it possible to have a formula that would only count if multiple criteria are met by searching vertically by playing around with COUNTIF, MATCH & OFFSET but in this case, I am finding it very difficult to do what I need.

    Please review the attached file.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: COUNTIF with unknowns

    Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!

  3. #3
    Registered User
    Join Date
    01-05-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    43

    Re: COUNTIF with unknowns

    Apologies, I didn't realise this would be an issue.

    Below is the data I have in column A.

    I am looking for a way to:

    1. Search for COMPLETE in the column
    2. If COMPLETE is found, match the unknown Ref which always starts with X and is 11 digits long
    3. Match that Ref to a User
    4. Count how many were found, so in this case, it should return 1 for each of the users.
    Last edited by Pepe Le Mokko; 01-17-2020 at 06:21 AM. Reason: I removed the data - Explanation is OK

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,585

    Re: COUNTIF with unknowns

    This proposal employs two helper columns, which may be moved and/or hidden for aesthetic purposes, and two helper cells (M2:N2) which are hidden by choosing white font.
    The first helper column (B) displays the name using: =IFERROR(RIGHT(A1,LEN(A1)-SEARCH("User ",A1)-4),"")
    The second helper column (C) displays the Ref using: =MID(A1,SEARCH("X",A1),12)
    M2:N2 are populated using: =INDEX($C1:$C18,MATCH(M$3,$B1:$B18,0))
    M5:N5 are populated using: =COUNTIFS($A$1:$A$18,"*"&$L5&"*",$C1:$C18,M2)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: COUNTIF with unknowns

    Array formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-05-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    43

    Re: COUNTIF with unknowns

    Thank you JeteMC & BMV! this is great stuff.

    Much appreciated!!

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,585

    Re: COUNTIF with unknowns

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. [SOLVED] Solve 4 equations with 4 unknowns
    By EssoExplJoe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-29-2017, 10:38 AM
  2. Solve problem with two variable unknowns
    By archiecc in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-06-2014, 11:19 AM
  3. solving 9 equations 9 unknowns in vba
    By Milade8080 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2014, 06:15 AM
  4. formula to solve for two unknowns
    By roninphx in forum Excel General
    Replies: 2
    Last Post: 02-03-2011, 08:35 PM
  5. Extract numeric value from a string of unknowns
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-01-2010, 12:00 PM
  6. 10 unknowns using 10 simultaneous equations
    By j_cash777 in forum Excel General
    Replies: 4
    Last Post: 01-31-2010, 07:12 PM
  7. [SOLVED] solving for 3 unknowns using 3 simultaneous equations
    By elaturnas in forum Excel General
    Replies: 0
    Last Post: 02-08-2005, 02:06 PM

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