+ Reply to Thread
Results 1 to 10 of 10

=COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

  1. #1
    Registered User
    Join Date
    03-28-2010
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    30

    =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Why wont this formula work?

    What mistake am I making please?

    Thanks

  2. #2
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    try this
    =SUMPRODUCT(--EXACT(C6:C7,"Su"))

  3. #3
    Registered User
    Join Date
    03-28-2010
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Hi, thanks but im not looking for the answer to a specific solution, I want to see where I am going wrong in the forumula string :-

    =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Can you describe in words what you want to do?

    The first argument of COUNTIF must be a range, C6:C7(EXACT(C6,"Su") isn't a range
    Audere est facere

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Quote Originally Posted by adamwestrop View Post
    ....I want to see where I am going wrong in the forumula string :-

    =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    DaddyLongLegs is right about what's wrong with the formula first parameter has to be a range, not a test.

    But I underlined the answer to your question "where am I going wrong?". You're using the wrong function. Sadath pointed to the correct function to use in Excel 2003, SUMPRODUCT(). In Excel 2007+ you would use COUNTIFS().
    Last edited by JBeaucaire; 07-30-2011 at 12:36 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    03-28-2010
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Sorry,

    Just messing round with formulas,

    OK amending to this then:-

    =COUNTIF(C6:C7,(EXACT(C6,"Su"),EXACT(C7,"Su"))

    Why isn't this working?

    Thanks

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    =COUNTIF(C6:C7, "Su")


    Press F1 in Excel and read up on the CountIf function.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    With respect, adam, you need to describe what you want to do, why are you using EXACT? that's normally used when you want a case-sensitive count - is that the case here?

  9. #9
    Registered User
    Join Date
    03-28-2010
    Location
    Norwich, England
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Sorry for the confusion guys, im trying to learn the basics on formula strings, and what a formula should be. Im not really trying to accompolish anything, just messing around.

    =COUNTIF(C6:C7,(EXACT(C6,"Su"),EXACT(C7,"Su"),"Su")

    This I thought with Count the cells C6 & C7 if the contents of those cells were exactly "Su".

    Again apologies for the confusion, I am really trying to get a handle on combining forumla etc and what formula strings should look like etc.

    Im trying to keep my worksheets very atomic by nature, so shouldn't have need for any complex formulas, however will be good to learn putting forumlas together and when I need to use certain strings etc.

    Thanks

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: =COUNTIF(C6:C7(EXACT(C6,"Su"),EXACT(C7,"Su")),="Su")

    Jerry's formula should do that for you (I assume C6 and C7 are text values not formatted dates). It isn't case-sensitive.

    Sadath's does the same.....but that is case-sensitive so it won't count SU or su for instance. For the case-sensitive version you need to use SUMPRODUCT because COUNTIF doesn't allow you to manipulate the range.

+ 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