Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005
    Posts
    41

    Unanswered: Counter based on another field

    I need to find a way to count the number of records in sequence based on two fields:

    abc 1234 1
    abc 4556 2
    def 1234 1
    def 4556 2

    I need to have column 4 count or sequnece column 2 and reset everytime column 1 changed.

    Any ideas or help is apreciated.

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,422
    Provided Answers: 8
    your message is a bit short

    have you tryed =countif(A:A,A1) Then pull it down so next line says =countif(A:A,A2)

    U mite have to join some cells =a1&b1 then do the countif on that cell
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Feb 2005
    Posts
    41
    Thanks for the quick response I will give that a shot. Think I found another work around that using an If statement but I like your solution a lot better.

    Quote Originally Posted by myle View Post
    your message is a bit short

    have you tryed =countif(A:A,A1) Then pull it down so next line says =countif(A:A,A2)

    U mite have to join some cells =a1&b1 then do the countif on that cell

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    Assumption: Your key field is in column A and your counter needs to be in column E.
    Cell E2 = 1
    Cell E3:
    Code:
    =IF(A3 = A2, E2+1, 1)
    Copy down as required.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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