+ Reply to Thread
Results 1 to 4 of 4

Excel VBA Countif for multiple criteria

  1. #1
    Registered User
    Join Date
    12-15-2014
    Location
    Wales, UK
    MS-Off Ver
    365
    Posts
    66

    Excel VBA Countif for multiple criteria

    I'm entering a CountIf formula in a cell. IT should count if both criteria are met. First if the name is in the list (Column 1) and 2nd if on the corresponding row that the name was found, column 10=1. It's the second part (Marked in red) that doesn't work.

    Please Login or Register  to view this content.
    EDIT: SOLVED with the following code:

    Please Login or Register  to view this content.
    Last edited by Simone Fick; 09-12-2017 at 06:07 PM. Reason: Solved

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Excel VBA Countif for multiple criteria

    Try COUNTIFS

    Edit* Oops, I see you figured it out.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Excel VBA Countif for multiple criteria

    For multiple criteria you should be using COUNTIFS not COUNTIF
    Have a go at making COUNTIFS function work in Excel first so that you understand the syntax and then try creating the VBA

    If you are still stuck when trying to create the VBA, come back to this thread and
    - attach a workbook with working COUNTIFS formula manually created
    - the workbook should make it clear how you want the output to look
    thanks

    TO ATTACH A WORKBOOK:
    Click on Reply
    Click on GOAdvanced
    Look below for ManageAttachments etc

    EDIT
    Ah - you got there on your own..
    Last edited by kev_; 09-12-2017 at 06:19 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Excel VBA Countif for multiple criteria

    Simone,

    This will also work as well
    Please Login or Register  to view this content.
    HTH,
    Maud

+ 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. Multiple Criteria for COUNTIF / IF / AND..in excel 2003!
    By Phoenix492 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-01-2015, 06:11 AM
  2. [SOLVED] COUNTIF - multiple criteria (excel 2003)
    By nat.ssnt in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-10-2013, 10:58 PM
  3. Countif, Multiple Criteria, Multiple Sheets, Excel 2003
    By shyammankoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-07-2013, 06:50 AM
  4. Replies: 2
    Last Post: 02-25-2011, 09:42 AM
  5. Excel 2003: COUNTIF/SUMPRODUCT, Multiple Criteria w/Wildcard
    By EricF in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-24-2008, 09:41 PM
  6. [SOLVED] How do I COUNTIF in excel using multiple criteria?
    By DJ_Swammi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2005, 03:55 PM
  7. how do I use COUNTIF in excel. using criteria from multiple colums
    By Zuki in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2005, 09:05 AM

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