+ Reply to Thread
Results 1 to 10 of 10

Create Duplicate records based on possible combinations of other values

  1. #1
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Create Duplicate records based on possible combinations of other values

    Cross post:
    https://www.mrexcel.com/board/thread...alues.1174658/

    Hi,

    Need your help with macros to create the output from the base data.
    I have a set of data from A1 to D1 refer below, based on the combinations which are there on H to J, I want to create the output in sheet 2.
    create duplicates.PNG

    Ex: I want to duplicate the data for Active and Inactive, and within Active High, Medium, Low and within High, High risk, low Risk and moderate risk and so on.
    like below.

    I have attached the file for reference.

    Regards
    Arvind

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,875

    Re: Create Duplicate records based on possible combinations of other values

    Note that on mrexcel there is already elegant solution with PQ
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: Create Duplicate records based on possible combinations of other values

    Hi Kaper,

    Power query is good, but I would request a VBA solution as I don't know power query and would be difficult for me to explain the logic to my team.

    I will continue to explore PQ, but needed macro

    Need some help here..

    Regards
    Arvind

  4. #4
    Registered User
    Join Date
    05-23-2013
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2016
    Posts
    22

    Re: Create Duplicate records based on possible combinations of other values

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Create Duplicate records based on possible combinations of other values

    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: Create Duplicate records based on possible combinations of other values

    Hi Zhou,

    apologies for the delay in response, got busy and couldn't respond
    This worked, Thanks a lot

    Regards
    Arvind

  7. #7
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: Create Duplicate records based on possible combinations of other values

    Hello Kv,

    Thanks for your help, this one as well worked, I assume you changed I4 and I5 just to get the result in an order, else that will work based on values on those fields.

    The data I provided is sample and actual data and values would be different.


    Regards
    Arvind

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Create Duplicate records based on possible combinations of other values

    If problem is solved, pl mark the thread SOLVED.

  9. #9
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: Create Duplicate records based on possible combinations of other values

    Hi All,
    I know I have marked this as solved, when i tried with actual data like this its not working, may be due to the number of rows in col H were 2 and now its 7, these ranges might change, hence wanted to keep it dynamic


    Dupl.PNG

    Thanks and sorry for the confusion

    Regards
    Arvind

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Create Duplicate records based on possible combinations of other values

    Here is the code for macro.

    Maindata=A3:d8
    ClmData=H2:K7

    Ranges can be changed.
    In both the ranges rows can be increased Columns cannot be increased. If columns are to be increased code should be edited.

    Please Login or Register  to view this content.
    Last edited by kvsrinivasamurthy; 06-30-2021 at 09:32 AM.

+ 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. [SOLVED] Create Duplicate Records Based on T+7 (Recurring Row Help)
    By knivesofice in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-29-2020, 12:58 PM
  2. Replies: 3
    Last Post: 12-28-2015, 04:58 PM
  3. Create new worksheet based of duplicate records
    By Qppg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-17-2011, 05:42 PM
  4. Create new worksheet with duplicate records
    By tip in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 04-20-2008, 11:02 PM
  5. Create new worksheet based of duplicate records
    By andym9 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2008, 11:01 AM
  6. Merging records / creating new columns based on duplicate records
    By duklaprague in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-19-2007, 10:32 AM
  7. Replies: 0
    Last Post: 07-19-2007, 02:58 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