+ Reply to Thread
Results 1 to 3 of 3

Macro. Number of rows in column that meet 2 criteria in other 2 columns. Use of "CountIfs"

  1. #1
    Registered User
    Join Date
    09-28-2016
    Location
    Paris
    MS-Off Ver
    2010
    Posts
    26

    Macro. Number of rows in column that meet 2 criteria in other 2 columns. Use of "CountIfs"

    Hi everyone!,

    Iīm doing an excel macro and need to calculate the number of cells in a column that meet 2 criteria in 2 other. In other words, letīs take that I want to calculate the number of rows in column "D" that meet that, in the same row but in column A, you have "blabla" and in column B you have a number lower than another priorly calculated number.

    Iīm trying to implement all this using the countifs function in VBA, as follows:
    The problem is that it returns an error and donīt know why. is it that the function is not well written, or is it that something else could have been wrong? (variable not declared, my excel version doesnīt support the countifs function, etc...)


    Ironically, the countif function works perfectly with just one criteria. Does anyone know what is it happening? if itīs not possible to proceed this way? would it be possible that you give me a good and quick alternative?


    Thanks a lot in advance for your kind responses.

  2. #2
    Registered User
    Join Date
    09-28-2016
    Location
    Paris
    MS-Off Ver
    2010
    Posts
    26

    Re: Macro. Number of rows in column that meet 2 criteria in other 2 columns. Use of "Count

    Application.CountIf works, but Application.CountIfs doesn't:

    I can't post the whole function I use, because the site blocks it.

    Thank you!
    Last edited by lcgar; 06-05-2017 at 02:07 PM.

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Macro. Number of rows in column that meet 2 criteria in other 2 columns. Use of "Count

    Not a VBA person, so can't help you there. If the argument includes a less than operator (<) then put a space behind it when posting.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Prevent Duplicate Receipt Number in Three Column [ e.g. Column "A", "B", "C" ]
    By MrsCharmy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-31-2017, 08:40 AM
  2. Struggling. sum of number of rows which meet criteria across columns
    By tyseley in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-22-2013, 05:43 AM
  3. [SOLVED] Macro to Delete Rows in Columns Based on Length of Column "A"
    By rmmohan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2013, 03:22 PM
  4. [SOLVED] Macro to insert excat number of rows as in column "K" below each line with data
    By awais6547 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-12-2012, 08:00 AM
  5. Replies: 10
    Last Post: 01-26-2012, 08:26 AM
  6. Delete Cells That Meet the Criteria of ""
    By concretetsunami in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-26-2010, 12:43 PM
  7. Replies: 0
    Last Post: 07-09-2009, 04:07 PM

Tags for this Thread

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