+ Reply to Thread
Results 1 to 7 of 7

Countifs, halfway there but not quite?

  1. #1
    Registered User
    Join Date
    01-23-2024
    Location
    Cardiff
    MS-Off Ver
    Latest (work)
    Posts
    2

    Countifs, halfway there but not quite?

    Hi Friendly People!

    Hoping for some help.

    Trying to get a countifs to work, if the reference number appears alongside any "1st" and any "2nd"

    I've got it to the point that I can have the reference number and the "1st" working but not both.. any tips?

    This is what i thought would work but it doesn't.

    =COUNTIFS(A:A,A2,B:B,"*1st*",B:B,"*2nd*")

    Reference Number Catergory
    123456 1st train 0
    123456 2nd train
    234567 1st bus
    234567 3rd train
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,707

    Re: Countifs, halfway there but not quite?

    Administrative Note:

    Welcome to the forum.

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,707

    Re: Countifs, halfway there but not quite?

    COUNTIFS is an AND function in operational terms. Try this:

    =SUMPRODUCT((A:A=A2)*((LEFT(B:B,3)="1st")+(LEFT(B:B,3)="2nd")))

    + works as an OR operator.

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Countifs, halfway there but not quite?

    Please add manually the expected results of the formula to your sheet.

  5. #5
    Registered User
    Join Date
    01-23-2024
    Location
    Cardiff
    MS-Off Ver
    Latest (work)
    Posts
    2
    Quote Originally Posted by HansDouwe View Post
    Please add manually the expected results of the formula to your sheet.
    Anything from a True to a 1, just need to track if it matches

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2412 (Windows 11 24H2 64-bit)
    Posts
    88,707

    Re: Countifs, halfway there but not quite?

    Please address both posts #2 and #3. If that doesn't solve it, do as Hans as asked.

    Please don't ignore or reject instructions and requests here. Thanks.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,529

    Re: Countifs, halfway there but not quite?

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Progressbar showing 100% as halfway finished
    By Bote in forum Excel General
    Replies: 3
    Last Post: 03-18-2019, 05:30 AM
  2. [SOLVED] Moving the columns halfway
    By roskalov in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-07-2017, 02:42 AM
  3. Macro for vlookup (halfway there)....
    By leswes14 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2013, 01:29 PM
  4. Nested If statement Help! halfway got it figured out
    By T_BOLT in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-26-2013, 02:41 AM
  5. Formula works halfway?
    By hottxboi16 in forum Excel General
    Replies: 1
    Last Post: 10-25-2006, 11:15 AM
  6. Macro running halfway only
    By Joe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2006, 01:55 PM
  7. if month is less than halfway over subtract 1
    By coal_miner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-04-2005, 11:06 AM

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