+ Reply to Thread
Results 1 to 8 of 8

CountIfs VBA

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    CountIfs VBA

    I am having trouble converting a SUMPRODUCT formula into a COUNTIFS. The line of code below contains the correct ranges.

    Please Login or Register  to view this content.
    Here is the original COUNTIFS formula:

    Please Login or Register  to view this content.
    My attempt errors on the underlined line. (object defined or application defined error)
    VB
    Please Login or Register  to view this content.
    Thank you.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: CountIfs VBA

    Why can't you use the original COUNTIFS formula?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: CountIfs VBA

    All the values are no longer on one sheet.

    VB
    Please Login or Register  to view this content.
    ? Thanks.

  4. #4
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: CountIfs VBA

    When I use that code instead, I get an objecy or application defined error on the underlined line. Thanks.

    VB
    Please Login or Register  to view this content.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: CountIfs VBA

    I meant to say that you should change any sheet/range references if required.

    Anyway, this will not cause an error.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: CountIfs VBA

    It is not the formula line that throws an error it is this line: Thanks.

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: CountIfs VBA

    The reason forthe error on that line of code is the formula being incorrect.
    Last edited by Norie; 06-28-2014 at 02:47 PM.

  8. #8
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: CountIfs VBA

    Thank you Norie , it is working now. I has an extra space and a $ in the formula.

+ 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. COUNTIFS OR COUNTIFS needs to work
    By joshbellfi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2013, 10:55 AM
  2. COUNTIFS OR...multiple countifs without duplication in the numbers
    By HooligaD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 09:53 AM
  3. Countifs Help
    By Jose9Reyes in forum Excel General
    Replies: 6
    Last Post: 02-16-2012, 08:21 AM
  4. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  5. Countifs
    By Wskip49 in forum Excel General
    Replies: 3
    Last Post: 09-27-2010, 04:27 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