+ Reply to Thread
Results 1 to 4 of 4

VBA code to return a count in a cell after cross checking three different criteria

  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    Portsmouth, NH
    MS-Off Ver
    Excel 2010
    Posts
    4

    VBA code to return a count in a cell after cross checking three different criteria

    Hello. I am trying to disseminate information to the appropriate cell in the grid below based on three attributes Discipline, Source, and Count (View attached picture for visual). For example: C65 should return the number of all the sources that from the discipline BTR and only have the source CAP-1 (should be 6). You're probably wondering "Whats the point for the Count row?" I need the Multiple column for the table to return the number for all the sources that have more than one source. For example: if D56 had CAP-1 AND Lloyds in the cell (delimited by a comma) then G65 would then have 1 in it.

    Can someone provide a solution in VBA for this problem? Capture.PNG

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: VBA code to return a count in a cell after cross checking three different criteria

    Did you try the COUNTIFS()-function?
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Registered User
    Join Date
    11-01-2013
    Location
    Portsmouth, NH
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA code to return a count in a cell after cross checking three different criteria

    the data range is not guarenteed to be the same each time this is run so I cannot reference specific cells or ranges for this. Is the COUNTIFS() function still a viable option?

  4. #4
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: VBA code to return a count in a cell after cross checking three different criteria

    I guess the COUNTIFS() function can be used, but depends on what you consider a "data range" and how the data range is filled with data.
    Hard to say on just screenshot.
    Could you post your workbook and if possible put some sample results in it to show what you're aiming at.

+ 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] Index Match (I think) cross checking multiple criteria
    By jimbokeep in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2013, 11:55 AM
  2. [SOLVED] How can I return a cross referenced cell value?
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 30
    Last Post: 09-06-2005, 07:05 PM
  3. [SOLVED] How can I return a cross referenced cell value?
    By JR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  4. How can I return a cross referenced cell value?
    By JR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. How can I return a cross referenced cell value?
    By JR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11: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