+ Reply to Thread
Results 1 to 10 of 10

Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

  1. #1
    Registered User
    Join Date
    12-09-2012
    Location
    Memphis, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    Hi,

    I hope i manage to express this question correctly but I basically want to get a result of row if an entry in a specified colum is EQUAL or SMALLER than a number in a different field.

    =COUNTIFS(Shipped!L:L,=<CY9) does not work....

    Thanks,
    Christine

  2. #2
    Forum Contributor Steve N.'s Avatar
    Join Date
    12-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    298

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    Can you post a sample of your work?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    =COUNTIFS(Shipped!L:L,"=<"&CY9)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    from a PM...
    Dibb,

    What does the & do in this process? I see it used quite often but I don't use countif much myself...so I'm unfamiliar...

    =COUNTIFS(Shipped!L:L,"=<"&CY9)

    Thanks, Steve
    the & concatanates/combines things, normaly text, so "=<"&CY9 gets turned into a criteria that the countifs() can recognise, if the reefernce is anything other than i direct reference, ie CY9, then you need to put the operators in quotes and combine then with the cell adress using &

    another use for & is when you want to combine (not add) the contents of a number of cells or add tect to an asnwer
    =A1&A2&A3&A4 if A1 contained John, A2 contained eats A3 contained 4 and A4 contained apples, you would get Johneats4apples
    =A1&" "&A2&" "&A3&" "&A4 would give you John eats 4 apples

  5. #5
    Registered User
    Join Date
    12-09-2012
    Location
    Memphis, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    Hello,

    Thanks a lot for the very fast reply. It did not work for me now, but i think i will need to test this further, as my formula is longer, and i may have gotten something else wrong. I will keep you posted.
    Christine

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    perhaps it would help you more if you revealed the full formula and what you are trying to do?

  7. #7
    Forum Contributor Steve N.'s Avatar
    Join Date
    12-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    298

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    I guess I'm confused by the operators in quotes - still don't get that part...do you have a 'for dummies' explanation/example?

  8. #8
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    The formula needs to be fixed. Change it to this:

    =COUNTIFS(Shipped!L:L,"<="&CY9)

    The < needs to come before the =

    - Moo

    * Also, why are you using COUNTIFS to test for just a single condition?
    Last edited by Moo the Dog; 12-09-2012 at 07:28 PM.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    @ Steve N...

    if the refernce for a countif (and a few other functions) is anything other than i direct reference, ie CY9, then you need to put the operators in quotes and combine then with the cell adress using &. and seeing as, in this instance, < and =, when combined, are considered text, they need quotes around them to keep everything "legal"

    @ Moo thanks for that catch =< vs<=. if i have ever done it that way before (cant recall if i have lol, but just tried it now) excel has auto-fixed it for me. and as for the use of countidS(), i figured the OP had a few other criteria to include, but again, good catch

  10. #10
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Problem COUNTIFS when result needs to be EQUAL or SMALLER than specified number/field

    @FD - sorry, the question about the single condition was aimed at the OP - I should have noted that.

    Thanks,
    Moo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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