+ Reply to Thread
Results 1 to 10 of 10

CountIf with Multiple Multiple Conditions!?!

  1. #1
    Registered User
    Join Date
    07-06-2011
    Location
    The PHX
    MS-Off Ver
    Excel 2007
    Posts
    11

    CountIf with Multiple Multiple Conditions!?!

    Hello Everyone,

    First time, long time - I've found help here numerous times but this time I'm stumped. My heartfelt gratitude is extended prior to anyone answering with the hope you are able to help.

    Here goes:
    I have a spreadsheet with almost 103,000 rows and 28 columns of data from which I'm creating multiple pivot tables.
    The rows in Column 'A' contain one of two values, either "Big" or "Sky". Column 'B' contains a Customer Number, a six-digit code. Column 'C' contains the formula =COUNTIF($B$2:$B$10300,$B2), giving me a count each Customer Number. This is great, I now know if that Customer Number is a one-time or repeat customer.

    The problem is, I now need to know if that Customer Number is a repeat customer of both "Big" AND "Sky". Is there a formula that can return something simple as a "1" or "Yes" - anything that will allow me to pull/sort in a pivot table - for this criteria.

    Make sense?
    Any/all help is appreciated...
    Last edited by Fister; 07-19-2011 at 12:20 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: CountIf with Multiple Multiple Conditions!?!

    have you looked at countifs?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: CountIf with Multiple Multiple Conditions!?!

    Hi,

    How about:

    Please Login or Register  to view this content.
    Entered with Ctrl-Shift-Enter.

    This should give you a True/False result.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: CountIf with Multiple Multiple Conditions!?!

    Going with Martin's COUNTIFS suggestion.......this formula will tell you whether a specific customer is both a Big and a Sky customer

    =PRODUCT(COUNTIFS(A$2:A$10300,{"Big","Sky"},B$2:B$10300,B2))>0

    If you want to know if a customer is a repeat customer for both, i.e. at least 2 transactions with both then change to

    =SUMPRODUCT((COUNTIFS(A$2:A$10300,{"Big","Sky"},B$2:B$10300,B2)>1)+0)=2
    Audere est facere

  5. #5
    Registered User
    Join Date
    07-06-2011
    Location
    The PHX
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: CountIf with Multiple Multiple Conditions!?!

    Thank you for your help, Conne and daddy!


  6. #6
    Registered User
    Join Date
    07-06-2011
    Location
    The PHX
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: CountIf with Multiple Multiple Conditions!?!

    My head hurts...
    There are now two new additions to column A - "Big", "Sky", "Lake", "Lodge" - and I include "Lake" and "Lodge" into the formula, it no longer marks and cell as True.

    What happened?

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: CountIf with Multiple Multiple Conditions!?!

    Which formula are you using?

  8. #8
    Registered User
    Join Date
    07-06-2011
    Location
    The PHX
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: CountIf with Multiple Multiple Conditions!?!

    =PRODUCT(COUNTIFS(A$2:A$10300,{"Big","Sky","Lake","Lodge"},B$2:B$10300,B2))>0

  9. #9
    Registered User
    Join Date
    07-06-2011
    Location
    The PHX
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: CountIf with Multiple Multiple Conditions!?!

    Quote Originally Posted by Fister View Post
    =PRODUCT(COUNTIFS(A$2:A$10300,{"Big","Sky","Lake","Lodge"},B$2:B$10300,B2))>0
    Ideas?
    Anyone?

  10. #10
    Registered User
    Join Date
    07-06-2011
    Location
    The PHX
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: CountIf with Multiple Multiple Conditions!?!

    =COUNTIFS($B$2:$B$10300,B2,$A$2:$A$10300,"<>"&A2)>0

    seems to work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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