+ Reply to Thread
Results 1 to 18 of 18

Match count multiple criteria

  1. #1
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Match count multiple criteria

    I am trying to find a formula that can return a count of matching postal codes in a range.
    For example:
    In row 1-> raw data of many postal codes (many cities)
    In row 2-> set range of postal codes (for a given city)

    Return value in row 3-> How many postal codes in raw data (row1) match the the set range of postal codes (row2)

    Any thoughts?

  2. #2
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    BTW the amount of postal codes i am talking about is in the range of hundreds. This is not a match of 2 or 3 postal codes. So a lot of the formula i looked at involved manual entering every postal code which i hope i will not have to do.

  3. #3
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    Try something like...

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    Thats what i am currently doing. Hoping there was another method that might be better.

  5. #5
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    I might've misread the first post.

    Are you looking to count the total number of postcodes in Row 1 that matches ALL of row 2?

    i.e.
    Row 1:1234, 2341, 3421, 4321
    Row 2: 1234, 4321
    Row 3: 2

  6. #6
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    Yes that is correct.

  7. #7
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    In that case, try this.

    Please Login or Register  to view this content.
    then press Ctrl + Shift + Enter

    (Ctrl + Shift + Enter = very important step)

  8. #8
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    I tried this and it returns value =0 which is incorrect I have true value of 362. Hmm.

  9. #9
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    Hmm. This is odd.

    Did you do the Ctrl shift enter thing?

  10. #10
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    yes. It put { } around the formula and returned a value of zero.

  11. #11
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    hmm... that is odd...

    is it possible for you to upload a sample file?

    (zipped, as my company proxy stupidly blocks xls and xlsx files)
    Last edited by quekbc; 04-21-2010 at 07:58 PM.

  12. #12
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    Here is a sheet of data.
    Attached Files Attached Files

  13. #13
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    I tried the formula in your worksheet. Seems to be working fine, with the exception that instead of rows, the data is in columns. That might be causing the problem.

    Please refer the attached file for clarification.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    hmm.. i was using A:A and B:B which prob why.

  15. #15
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    Interesting... I tried using A:A and B:B... it does give 0.

    Guess that's the root of the problem.

    Very interesting.

  16. #16
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Sort Ascending Order VBA formula

    I would like to know the formula that performs the same operation as the Sort Ascending button.

  17. #17
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Match count multiple criteria

    That requires clever programming (there's a whole topic on sorting in programming classes).

    I'd recommend starting a new thread so others with better expertise can have a look at it.

    Edit:

    Try, Record Macro, sort the data, Stop Recording. and see what churns up.
    Last edited by quekbc; 04-21-2010 at 09:29 PM. Reason: just thought of something.

  18. #18
    Registered User
    Join Date
    04-21-2010
    Location
    BC
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Match count multiple criteria

    record macro.. thanks i should have thought of that.

+ 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