+ Reply to Thread
Results 1 to 8 of 8

Help with Excel (MacOS) formula for duplicating rows with unique data in certain columns

  1. #1
    Registered User
    Join Date
    08-08-2019
    Location
    Florida
    MS-Off Ver
    16.16.12 for Mac
    Posts
    3

    Help with Excel (MacOS) formula for duplicating rows with unique data in certain columns

    Here's an example of my table:

    Please Login or Register  to view this content.
    I want to turn the above list into this:

    Please Login or Register  to view this content.
    … you get the idea.

    I have 2200 contacts and some of them have as many as 28 different phone numbers (!!!) affiliated with their account, and I want each contact to have a separate row for each phone number they have.

    I was trying to just add 28 blank rows under each contact row, and then using the TRANSPOSE function, but there’s no quick way to “add 28 rows” below each current row, nor is there a quick way to copy the transpose formula every 28 rows. I’m hoping there’s an easier (or at least faster) way to accomplish what I’m trying to do.

    Thanks in advance for any help!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    Hi Britt and welcome to the forum,

    I'm not sure if your version of Excel has Power Query yet. But, using my PC with Excel 365 and the 2010 tool called Power Query your problem is pretty easy. The secret is to UnPivot Other columns. I took your data from sheet1 and did PQ on it using UnPivot Other columns and then removed blank rows of Phone numbers and see sheet2. (I really trimmed the phone numbers before I removed blanks)

    Does that help? See attached: UnPivot Other for Britt.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    08-08-2019
    Location
    Florida
    MS-Off Ver
    16.16.12 for Mac
    Posts
    3

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    Thanks so much for the suggestion! I got really excited and started researching "Power Query", and unfortunately it looks like it's not available on Excel for Mac. I'm extremely bummed about it... If you have any other suggestions, I'd love to try them!

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    OK Britt,

    Long before Power Query and UnPivot I wrote some VBA code to do a similar thing.

    I've added that VBA to the attached file. Warning - make a backup of your data to run this macro on. See if it does what you want.
    You have 3 Fixed columns, First, Last and Address. See my Start sheet and run the macro on it. Copy your data into this sheet and run the macro again. (Keep your fingers crossed)
    Make CrossTab a Table for Britt.xlsm

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    Hi Britt,
    I assum output data is from K2:

    In K2:=A2
    Copy to L2
    K3:
    Please Login or Register  to view this content.
    Copy to L3
    M2:
    =LOOKUP(2,1/($A$2:$A$5=$K2)/($B$2:$B$5=$L2),$C$2:$C$5)
    N2 (array formula, confirm by Ctrl-shift-enter)
    =INDEX($D$1:$F$5,MATCH($K2&$L2,$A$1:$A$5&$B$1:$B$5,0),AGGREGATE(15,6,COLUMN($D:$F)/(INDEX($D$1:$F$5,MATCH($K2&$L2,$A$1:$A$5&$B$1:$B$5,0),)<>""),COUNTIFS($K$2:$K2,$K2,$L$2:$L2,$L2))-3)
    Attached Files Attached Files
    Quang PT

  6. #6
    Registered User
    Join Date
    08-08-2019
    Location
    Florida
    MS-Off Ver
    16.16.12 for Mac
    Posts
    3

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    WOW - Amazing! This worked like a charm!!! I honestly can't thank you enough. I am SO grateful! Is there any way I can pay you for your help? I don't have a lot, but if you accept PayPal, I'd love to send you a couple of bucks. This has saved me HOURS!

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    Hey Britt,
    We all work for free and to get a good "Thank You" like you gave. We also appreciate "Add Reputation" points. Click on the "* Add Reputation" below the answer(s) you like and give a comment.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Help with Excel (MacOS) formula for duplicating rows with unique data in certain colum

    Quote Originally Posted by Britt23 View Post
    WOW - Amazing! This worked like a charm!!!
    Haha, nice to hear it works . We're all volunteers working for our own hobby.

+ 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: 4
    Last Post: 02-14-2019, 10:38 AM
  2. Replies: 5
    Last Post: 01-25-2017, 05:23 AM
  3. Excel Duplicating Frozen Rows/Columns
    By pmcelroy36 in forum Excel General
    Replies: 1
    Last Post: 03-10-2016, 09:57 AM
  4. Extract unique data from rows to columns
    By CherryBlossom in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2013, 05:12 AM
  5. Duplicate rows, delete columns w/same data, combine columns w/unique data, Mac Excel 2011
    By msmcoin in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 02-03-2013, 02:10 PM
  6. Replies: 2
    Last Post: 05-08-2012, 07:17 PM
  7. Macro for combining columns and duplicating rows based on data
    By abuchan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-27-2011, 01:57 AM

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