+ Reply to Thread
Results 1 to 23 of 23

Countif multiple criteria

  1. #1
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Countif multiple criteria

    Hi friends,


    Please help me to solve below issue :

    Please see attachment


    In the attachment Contract no. is same, but invoice numbers are two, So I want "1" for first invoice rows and "2" for second invoice rows in C Column.

    Thank you.
    Attached Files Attached Files
    Last edited by rajeshn_in; 07-20-2019 at 10:43 AM.

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

    Re: Countif multiple criteria

    Looking at this on an iPad so I can't see your formula.

    But, if there are multiple criteria, you need to us COUNTIFS not COUNTIF
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    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
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    I didn't use any formula in my sheet, I want formula for C column.

    Thank you

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Countif multiple criteria

    Please try at C2
    =SUMPRODUCT(1/COUNTIF(B$2:B2,B$2:B2))

    or
    =SUMPRODUCT(1/COUNTIFS(B$2:B2,B$2:B2,A$2:A2,A$2:A2))
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Thank you very much

  6. #6
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Dear Friends,

    Please solve the below problem. I am unable to clear my problem with previous solution. I am very sorry for reopening this issue.

    I want formulas to get same result for lot no. (C columns).


    LOT NO.jpg

    Thank you.
    Attached Files Attached Files
    Last edited by rajeshn_in; 08-10-2019 at 08:06 AM.

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: Countif multiple criteria

    Attach the new workbook.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Dear Aligw,

    Previous post edited with attachment.

    Thank you

  9. #9
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: Countif multiple criteria

    There are no expected outcomes and I don't know what you mean by the criteria.

    Help us to help you!!!

  10. #10
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: Countif multiple criteria

    Please see the anomalies highlighted:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    1
    CONTRACT NO. INVOICE NO. LOT NO. CRITERIA
    2
    RG / JSSL / 0202 / 19 INV1022019
    1
    BOTH FIRST TIME
    3
    RG / JSSL / 1111 / 19 INV1022019
    1
    BOTH FIRST TIME B is a repeat
    4
    RG / JSSL / 0202 / 19 INV1022019
    1
    BOTH REPEATED
    5
    RG / JSSL / 0202 / 19 INV1022019
    1
    BOTH REPEATED
    6
    RG / JSSL / 0202 / 19 INV1022020
    2
    A - SECOND TIME, B - FIRST TIME A is a repeat
    Sheet: Sheet1

    You are going to have to explain what you mean, because your outcomes seem to be incorrect.

  11. #11
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Contract No. & Invoice Nos. coming first time then Lot No. 1

    Lot no should change only invoice number change for that contract no.

    Repeated Contract & Invoice Nos (combo) should have same Lot no.

  12. #12
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: Countif multiple criteria

    Please provide your expected results.

  13. #13
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    My expected result is in C column.

  14. #14
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Contract No. & Invoice Nos. coming first time then Lot No. 1


    Lot no should change only invoice number change for that contract no.
    OR
    Lot no should change only contract no. change for that invoice no.


    Repeated Contract & Invoice Nos (combo) should have same Lot no.

  15. #15
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: Countif multiple criteria

    This makes no sense to me at all:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    1
    CONTRACT NO. INVOICE NO. LOT NO. CRITERIA
    2
    RG / JSSL / 0202 / 19 INV1022019
    1
    BOTH FIRST TIME
    3
    RG / JSSL / 1111 / 19 INV1022019
    1
    BOTH FIRST TIME
    Sheet: Sheet1

    I'm out - sorry.

  16. #16
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    For 0202 contract - Invoice coming first time
    For 1111 contract - invoice coming first time

  17. #17
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: Countif multiple criteria

    Yes, precisely - so how can they BOTH be the first time in row 3?

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Countif multiple criteria

    I am struggling here. Open the sheet. Please justify the expected answer for the two sets of shaded cells.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  19. #19
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Glenn Kennedy,

    Please check attachment
    Attached Files Attached Files

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Countif multiple criteria

    There nothing there that explains what you are doing. All you have done is move the shading around a bit, as far as I can see!!! The values in column C seem to be unrelated to the comments in column D...

  21. #21
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Countif multiple criteria

    This half works... but does not deliver your expected results after row 8.

    Explain with NEW words, the reasons why your expected results are NOT the ones shown in YELLOW in this sheet. Totally baffled.
    Attached Files Attached Files

  22. #22
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Countif multiple criteria

    Please try at C2
    =SUMPRODUCT(1/COUNTIF(INDEX(B$2:B2,MATCH(A2,A$2:A2,)):B2,INDEX(B$2:B2,MATCH(A2,A$2:A2,)):B2))
    Attached Files Attached Files

  23. #23
    Forum Contributor
    Join Date
    04-06-2016
    Location
    Singapore
    MS-Off Ver
    MS Office 365 & 2010
    Posts
    698

    Re: Countif multiple criteria

    Thank you Bo_Ry & Glenn Kennedy.

    I will go with Bo_Ry solution.

+ 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. Countif Multiple Criteria
    By dyrflr21 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-05-2013, 02:20 PM
  2. Countif, Multiple Criteria, Multiple Sheets, Excel 2003
    By shyammankoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-07-2013, 06:50 AM
  3. [SOLVED] trying to do a "countif" with multiple ranges and multiple criteria. Countif, Sumproduct?
    By completelyhis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 06:12 PM
  4. Trying to COUNTIF when multiple criteria are met on multiple column data set
    By TGCRequiem in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-15-2011, 12:58 AM
  5. Countif Multiple Criteria
    By JoatNIC in forum Excel General
    Replies: 1
    Last Post: 08-10-2005, 05:05 PM
  6. Countif w/ Multiple Criteria-How do I use countif
    By Patrick_KC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2005, 05:05 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