+ Reply to Thread
Results 1 to 10 of 10

Create duplicate numbers for consecutive and duplicate data

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-21-2019
    Location
    Tabriz,Iran
    MS-Off Ver
    2024
    Posts
    195

    Create duplicate numbers for consecutive and duplicate data

    Hi all,

    I need this expeted result
    without VBA, please

    Thanks
    8.gif
    Attached Files Attached Files
    Last edited by Yaghoub61; 12-15-2021 at 11:27 AM.
    Notice:
    my main language is not English

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Create duplicate numbers for consecutive and duplicate data

    You can use this in C2:

    =IF(COUNTIF(B$2:B2,B2)=1,1,IF(B2=B1,C1,MAXIFS(C$1:C1,B$1:B1,B2)+1))

    If you are still using XL2010 as your profile states, then you won't have access to the MAXIFS function, so you will need to use an array formula instead.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,910

    Re: Create duplicate numbers for consecutive and duplicate data

    2010 array formula

    =IF(COUNTIF(B$2:B2,B2)=1,1,IF(B2=B1,C1,MAX(IF(B$1:B1=B2,$C$1:$C1)+1)))

    Enter with Ctrl+Shift+Enter
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create duplicate numbers for consecutive and duplicate data

    This MIGHT be an ordinary formula in Excel 2010... but I am not 100% sure.

    IF(COUNTIF(B$2:B2,B2)=1,1,IF(B2=B1,C1,AGGREGATE(14,6,$C$1:$C1/(B$1:B1=B2),1)+1))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,910

    Re: Create duplicate numbers for consecutive and duplicate data

    @Glenn,
    MIGHTy right! works in 2010.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Create duplicate numbers for consecutive and duplicate data

    Woo Hoo! It's amazing how quickly you forget what does/does not require array entry...

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Create duplicate numbers for consecutive and duplicate data

    AGGREGATE is like SUMPRODUCT - they work on arrays, but don't need to be array-entered.

    Pete

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Create duplicate numbers for consecutive and duplicate data

    Please try

    =IF(B2=B1,C1,IFERROR(LOOKUP(99,C$1:C1/(B$1:B1=B2)),0)+1)
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    05-21-2019
    Location
    Tabriz,Iran
    MS-Off Ver
    2024
    Posts
    195

    Re: Create duplicate numbers for consecutive and duplicate data

    Thank you all

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Create duplicate numbers for consecutive and duplicate data

    Glad to help, and thanks for the rep.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Avoid duplicate data. Block/advice me from entering duplicate data.
    By DANNYBOY0109 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-22-2019, 10:18 AM
  2. Avoid duplicate data. Block/advice me from entering duplicate data.
    By DANNYBOY0109 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-14-2019, 05:54 AM
  3. Data base with duplicate numbers
    By pick44 in forum Excel General
    Replies: 8
    Last Post: 06-22-2017, 01:04 PM
  4. [SOLVED] Removing consecutive duplicate only
    By Galuppo in forum Excel General
    Replies: 0
    Last Post: 07-19-2016, 01:53 PM
  5. VBA To Replace Consecutive Duplicate Values
    By Jamsandwich in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2015, 05:22 AM
  6. Search column a for duplicate data and copy entire row to duplicate sheet
    By crazyAMP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 08:21 PM
  7. Create a new list that singles out duplicate numbers
    By moglione1 in forum Excel General
    Replies: 1
    Last Post: 08-18-2005, 02:05 PM

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