+ Reply to Thread
Results 1 to 10 of 10

COUNTIFS with IFS and ANDS

Hybrid View

  1. #1
    Registered User
    Join Date
    09-28-2021
    Location
    london uk
    MS-Off Ver
    Office 365
    Posts
    55

    COUNTIFS with IFS and ANDS

    Please can I have help with two different queries on the attached spreadsheet?

    1) I need a formula that counts if the value in column H is "NF01" AND the value in column F is either "Cans", "Bottles", OR "Britvic". I'm not sure how to factor in the either/or element for column F.

    2) Column G contains engineer numbers, and the numbers correspond to a region. Any engineer number between 1000-1999 is East, between 2000-2999 is West, and so on. Is there a way to count how many times column H is "NF01" for each region?

    Thanks so much
    Attached Files Attached Files
    Last edited by clari55a; 09-28-2021 at 11:18 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.85 (24051214))
    Posts
    8,817

    Re: COUNTIFS with IFS and ANDS

    A few ways to do 1
    but i would use
    =COUNTIFS(H3:H23,"NF01",F3:F23,"cans")+COUNTIFS(H3:H23,"NF01",F3:F23,"Bottles")+COUNTIFS(H3:H23,"NF01",F3:F23,"Britvic")

    lookign at 2

    how many regions
    and 1000 is the start

    can you change the column to numbers, all the Numbers are set to text, using TEXT to Columns ?
    if not may need to use a sumproduct -

    if so then you could use
    =COUNTIFS($H$3:$H$23,"NF01",$G$3:$G$23,">="&I6,$G$3:$G$23,"<="&I6+999)
    With the numbers reference in column I
    Attached Files Attached Files
    Last edited by etaf; 09-28-2021 at 10:47 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    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,503

    Re: COUNTIFS with IFS and ANDS

    Shorter

    =SUM(COUNTIFS(H3:H23,"NF01",F3:F23,{"Cans","Bottles","Britvic"}))

    and entry in list was BOTTLE not BOTTLES: adjust to which ever
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    09-28-2021
    Location
    london uk
    MS-Off Ver
    Office 365
    Posts
    55

    Re: COUNTIFS with IFS and ANDS

    Thank you soooo much! It works!

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,461

    Re: COUNTIFS with IFS and ANDS

    Also
    Formula: copy to clipboard
    =SUMPRODUCT(--(H3:H23="NF01"),--((F3:F23="cans")+(F3:F23="bottle")+(F3:F23="britvic")))

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,461

    Re: COUNTIFS with IFS and ANDS

    For your second question you need to add a column with the Regions

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: COUNTIFS with IFS and ANDS

    Using SUMPRODUCT.

    WBD
    Attached Files Attached Files
    Office 365 on Windows 11, looking for rep!

  8. #8
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,447

    Re: COUNTIFS with IFS and ANDS

    WBD - could you please post the formula itself? Some members may be unable to access attachments. Thanks.
    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.

  9. #9
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,109

    Re: COUNTIFS with IFS and ANDS

    Hi
    for the 1st one try:
    =SUM((($F$3:$F$23="BOTTLE")+($F$3:$F$23="Britvic")+($F$3:$F$23="CANS"))*($H$3:$H$23="NF01"))

    For the 2nd question - this is the formuila for the east NF01 combo.
    change the number range for the others:
    SUM(($G$3:$G$23>=1000)*($G$3:$G$23<=1999)*($H$3:$H$23="NF01"))

  10. #10
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,447

    Re: COUNTIFS with IFS and ANDS

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. More IFS & ANDS
    By Geekynerd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2018, 12:23 PM
  2. [SOLVED] IFS and ANDS
    By Geekynerd in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-08-2018, 10:57 AM
  3. if and ands
    By sophia_1234 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2014, 03:01 PM
  4. COUNTIFS function with ANDs and ORs
    By Deutz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-26-2014, 11:44 PM
  5. [SOLVED] Ifs ands countifs
    By HCBalelo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-26-2012, 01:34 PM
  6. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  7. CountIFS / Ands or Buts :)
    By Rino468 in forum Excel General
    Replies: 3
    Last Post: 07-08-2011, 01:56 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