+ Reply to Thread
Results 1 to 12 of 12

Adding multiple criteria to formula

  1. #1
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Adding multiple criteria to formula

    Hi excel forum,

    I am using the following formula to count across multiple worksheets

    Please Login or Register  to view this content.
    I was wondering it it was possible to add multiple criteria to this formula so it counts the cells indicated if 1 of the criterias it matched.

    So if E2 & E3 are the criteria and 1 of them is matched it counts how many.

    If a example sheet is needed let me know.

    Thanks in advance

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Adding multiple criteria to formula

    A sample sheet would help!!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Re: Adding multiple criteria to formula

    Please see example workbook
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    02-07-2016
    Location
    England
    MS-Off Ver
    2019
    Posts
    270

    Re: Adding multiple criteria to formula

    Not to worry i worked it out myself, this seemed to work

    Please Login or Register  to view this content.
    If someone thinks they have a more simple way suggestions are appreciated.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Adding multiple criteria to formula

    Surely that only counts A1??

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&B3:B5&"'!A1:A4"),{"A","B"}))

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding multiple criteria to formula

    Since you have Excel 2016:

    Why not use Power Query to get all data on 1 sheet and after that analyse the data?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Adding multiple criteria to formula

    PowerQuery is as powerful as its name suggests, but is still very new or completely unknown to many users. It would help, therefore, if those 'in the know' would offer an explanation of how to solve problems like this with it when they see a use for it.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding multiple criteria to formula

    @AliGW

    I could do that, but the added examples give not much information to show.

    In general:

    My statement would be that, in most of the times, it is usefull to use just 1 sheet instead of a lot of worksheets.

    With just one sheet it is a lot easier to analyse the data.



    So even if a forummember don't have the Excel 2016 version I would recommend to built a file that way.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Adding multiple criteria to formula

    So what do you need from the OP to be able to demonstrate the PowerQuery solution? Many of us are keen to learn more about it.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding multiple criteria to formula

    More in general:

    I use this code (a lot) to get all sheets on 1 summary sheet.

    You have to accept macro's to run the code.

    See the result in the attached file.

    Please Login or Register  to view this content.
    After that I will take a look if I can explain how this can be done with PivotQuery.
    Last edited by oeldere; 09-24-2017 at 06:50 AM.

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Adding multiple criteria to formula

    for the powerquery tool i will take a look if I understand how to add data of differant sheets together.

    If so, I will post that.

    If not, I will post that either.

    If there are more experienced members on this topic, feel free to step in.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: Adding multiple criteria to formula

    Try

    =SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!A1:A10"),D1:E1))

    "Sheets" is named range of the list of sheets i.e, B3:B5
    Attached Files Attached Files

+ 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] Adding multiple criteria in same column
    By nickmartino in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-24-2014, 10:56 AM
  2. Adding multiple names as a criteria
    By IMAniINA in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-14-2014, 01:34 AM
  3. [SOLVED] Adding and multiple criteria into an Index
    By clowesr in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-08-2013, 06:03 AM
  4. [SOLVED] Adding from multiple cells but only using one cell for criteria
    By PapaCheese in forum Excel General
    Replies: 6
    Last Post: 05-04-2012, 01:06 PM
  5. Replies: 2
    Last Post: 10-05-2011, 12:43 PM
  6. Adding multiple columns with similar criteria
    By cellslinger in forum Excel General
    Replies: 7
    Last Post: 09-10-2011, 02:18 AM
  7. Adding values, multiple criteria
    By gdwright07 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2008, 04:42 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