Results 1 to 7 of 7

Thread: formula help

  1. #1
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts

    formula help

    greetings,

    Assume I have data in columns a,b as below and I want a formula to help me assign a sequence number to only the first four for each code as in column c, appreciate any idea.

    code name seq
    sage char-1 1
    sage karl-2 2
    sage hans-3 3
    sage carn-4 4
    sage cand-5
    sage char-2
    sage karl-3
    sage hans-4
    barg farh-7 1
    barg simn-10 2
    barg hakr-99 3
    drag bakr-123 1
    drag funn-300 2
    drag sams-100 3
    drag bakr-124 4
    drag funn-301
    drag sams-101
    Last edited by dubdub; 2016-06-14 at 03:43.
    TIA
    dubdub

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Are they sorted by code?
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yes they are.
    TIA
    dubdub

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Then in C2:
    =IF(A2=A1,IF(C1<4,C1+1,""),1)
    and copy down.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    3 Star Lounger
    Join Date
    Jul 2005
    Location
    Bahrain
    Posts
    373
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Perfect, thank you so much Rory.
    TIA
    dubdub

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    You're welcome.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,640
    Thanks
    115
    Thanked 651 Times in 593 Posts
    An alternative formula in C2:

    =IF(COUNTIF($A$2:A2,A2)>4,"",COUNTIF($A$2:A2,A2))

    then copy down

Posting Permissions

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