+ Reply to Thread
Results 1 to 9 of 9

Count the repeated number using VBA

  1. #1
    Registered User
    Join Date
    12-23-2008
    Location
    Chennai,India,Tamilnadu
    Posts
    70

    Thumbs up Count the repeated number using VBA

    Dear Friends,

    Please find the enclosed file for the problem.

    Please help me to write a VBA code for this issue.

    Thanks
    M.Velmurugan
    Attached Files Attached Files
    Last edited by mvel_sky; 07-30-2009 at 04:57 AM. Reason: Forget the attachment

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Count the repeated number using VBA

    Hi,

    Try this..

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Count the repeated number using VBA

    Hmmm no VBA needed simply put this in in E3 and copy down =SUMPRODUCT((I3:I15=B3)*(J3:J15)) and this in D3 and copy down =SUMPRODUCT((I3:I15=B3)*(J3:J15=0))
    Not all forums are the same - seek and you shall find

  4. #4
    Registered User
    Join Date
    12-23-2008
    Location
    Chennai,India,Tamilnadu
    Posts
    70

    Re: Count the repeated number using VBA

    Thank You Very much... It is working...

    But when i copy the formulae to my master file and modified accordingly, it is not working... All values are showing as zero... (File enclosed)

    Please help...
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Count the repeated number using VBA

    Hi
    If you had provided excel data instead of image, it would have been better.
    try =sumproduct(($V$7:$V$59=E67)*($AF$7:$AF$59=0))
    Ravi

  6. #6
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Count the repeated number using VBA

    Quote Originally Posted by mvel_sky View Post
    Thank You Very much... It is working...

    But when i copy the formulae to my master file and modified accordingly, it is not working... All values are showing as zero... (File enclosed)

    Please help...
    The reason is you changed one of the ranges in the SUMPRODUCT to be inconsistent, SUMPRODUCT needs to have identical ranges so if you used A1:A100 in the criteria portion then you must use the same range dimensions in the rest i.e B1:B100 you cannot use something like B2:B59.

  7. #7
    Registered User
    Join Date
    12-23-2008
    Location
    Chennai,India,Tamilnadu
    Posts
    70

    Thumbs up Re: Count the repeated number using VBA

    Thanks for your valuable comments.

    But if i enter the formulae in my original file, it is not working.

    I have enclosed the original file for your ref...

    Please do the needful.

    Regards
    M.Velmurugan
    Attached Files Attached Files

  8. #8
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Count the repeated number using VBA

    Simply change the V in the formula to Q, you cannot sumproduct a concatenation!

  9. #9
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Count the repeated number using VBA

    Hi
    see the attached file
    Ravi
    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)

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