Consulting

Results 1 to 7 of 7

Thread: Solved: countifs in excel 2003

  1. #1

    Solved: countifs in excel 2003

    Hi All,
    I'm busy trying to code the equivelant code in excel 2007 for
    [vba]=COUNTIFS($C$7:$C$599,"quality",$H$7:$H$599,"g")[/vba]

    I have tried using
    [vba]=SUMPRODUCT(--($C7:$C599="supplier"),--($H7:$H599="g"))[/vba]
    in excel 2003 but I don't seem to get it right.
    Can anyone help
    Thanks
    Lee

  2. #2
    VBAX Mentor anandbohra's Avatar
    Joined
    May 2007
    Location
    Mumbai
    Posts
    313
    Location
    Try this

    [VBA]=SUMPRODUCT(($C$7:$C$599="supplier")*($H$7:$H$599="g"))[/VBA]
    Always Mark your Thread as Solved the moment u got acceptable reply (located under Thread tools)
    Practice this & save time of others in thinking for unsolved thread

  3. #3
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Hi Lee,

    I still forget proper use of SP faster than heck, but what is the above not doing. Seems to add okay for me.

    Mark

  4. #4

    Thumbs up

    Hi Mark,
    Did eventually get it with
    [VBA]=SUMPRODUCT(($C$7:$C$599="supplier")*($H$7:$H$599="g"))[/VBA]
    Thanks very much works fine now
    Cheers
    Lee

  5. #5
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    I'm glad anadbohra's suggestion worked

    (Back to reading about SP for me )


    Cheers to you also,

    Mark

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    There is no obvious reason that your formula does not work but the alternative does.

    Can you post the workbook so that we can track down why?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Hi XLD,
    Tried the same formula again after fixing my workbook references and I had made a mistake with my workbook, both of the formulas do infact work.
    [VBA]=SUMPRODUCT(($C$7:$C$599="supplier")*($H$7:$H$599="g"))[/VBA]
    and
    [VBA]=SUMPRODUCT(--($C7:$C599="supplier"),--($H7:$H599="g"))[/VBA]

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •