+ Reply to Thread
Results 1 to 8 of 8

Alternate data in columns A and B (AAAB, AAAB repeat)

  1. #1
    Registered User
    Join Date
    03-16-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    26

    Alternate data in columns A and B (AAAB, AAAB repeat)

    I have data in Column A (A2 down) and data in Column B (B2 down) and I want Column D to display in this order: AAAB, AAAB, repeat.

    I currently have Column D going down, showing AAB, AAB, with this formula:

    =@INDEX($A$2:$B$3000,IF(MOD(ROWS(D$2:D2),3)<>0,ROWS($D$2:$D2)-INT(ROWS($D$2:$D2)/3)*1,INT(ROWS($D$2:$D2)/3)),1+(MOD(ROWS($D$2:$D2),3)=0))

    What do I change in the above, so that it displays 3 A's instead of 2?

    I have almost 3000 rows, so I need to be able to simply copy D2 and paste down.

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

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    I do not understand you. Please post a small sample Excel file, showing expected results.
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    03-16-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    26

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    Quote Originally Posted by Glenn Kennedy View Post
    I do not understand you. Please post a small sample Excel file, showing expected results.
    Please see attached sheet.
    Attached Files Attached Files

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    One way (your way):

    Please replace the 3's in your formula with 4's:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 12-23-2023 at 05:06 AM.

  5. #5
    Registered User
    Join Date
    03-16-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    26

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    Quote Originally Posted by HansDouwe View Post
    One way (your way): Please replace the 3's in your formula by 4's:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thanks buddy, that seems to work!

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    You are Welcome!

    Thanks for the feedback and rep .

    Glad to have helped.

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

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    This might throw a row or two of errors, if the number of values in column A is not an exact multiple of 3. Try it out:


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-23-2023
    Location
    India
    MS-Off Ver
    2311
    Posts
    2

    Re: Alternate data in columns A and B (AAAB, AAAB repeat)

    I did the same thoing with two helper columns
    One for mod and one flag. Have attached the snip-it

    =INDEX($D$5:$E$11,IF(G11=0,MATCH(COUNTIFS(OFFSET($G$5,0,0,C11,1),0),$C$5:$C$11,0),MATCH(COUNTIFS(OFFSET($G$5,0,0,C11,1),1),$C$5:$C$11,0)),IF(G11=0,1,2))

+ 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. Replies: 5
    Last Post: 08-06-2023, 02:18 PM
  2. Alternate data in columns A and B and input to Column D
    By burnleysteve in forum Excel General
    Replies: 13
    Last Post: 12-23-2021, 12:18 PM
  3. [SOLVED] copy data from columns to columns with repeat names and numbers
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-12-2020, 06:41 PM
  4. Replies: 4
    Last Post: 02-12-2017, 10:20 PM
  5. Delete every alternate columns till the last data in the row from column G
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2012, 11:59 PM
  6. Replies: 2
    Last Post: 08-24-2005, 12:05 PM
  7. Replies: 3
    Last Post: 04-28-2005, 12:06 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