+ Reply to Thread
Results 1 to 7 of 7

trying to create a dynamic range based on column A cell value...index match?

  1. #1
    Registered User
    Join Date
    01-22-2011
    Location
    Long Beach CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    trying to create a dynamic range based on column A cell value...index match?

    I have a worksheet that has 2 columns of information (simplified version).

    Column A has a non-sorted, nonlinear, list of part numbers, descriptions and some empty cells.
    It is divided into variable row sections by “header” characters. These characters are [1], [2], [3], etc. UP TO [20] (with the brackets)

    Column B has the associated quantities of each part.

    I would like a macro that will set up columns C,D,E,F,G,H,I,J,K,L so that I can move the part quantities under rows below [1] and above [2] to column C,part quantities under rows below [2] and above [3] to column D, and so on.

    When complete, all quantities will be in the same row they originated in, but would shift to the column associated with the “header” character. ( Section [1] quantities in column C., Section [2] quantities in column D.,etc.)

    I've tried to use MATCH to identify the row each "header" is in to create a dynamic range, but cant seam to use the result as part of a formula...
    Im running out of ideas..., could really use some help on this.

    Just for clarity, the source & result should look like this:
    (thanks in advance)

    sort.jpg
    Last edited by dbq; 08-27-2014 at 02:30 PM.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: trying to create a dynamic range based on column A cell value...index match?

    Please post an example spreadsheet so this is easier to answer.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    01-22-2011
    Location
    Long Beach CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: trying to create a dynamic range based on column A cell value...index match?

    Here's a spreadsheet showing the before (sheet 1) and after (sheet 2)
    thank you.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-22-2011
    Location
    Long Beach CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: trying to create a dynamic range based on column A cell value...index match?

    Is this even possible? Or is a better description required?

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: trying to create a dynamic range based on column A cell value...index match?

    I didin't try to find an answer yet, but I am curios what you want to achieve.

    What is your exactly goal, after you put it in columns (instead of rows).
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: trying to create a dynamic range based on column A cell value...index match?

    You could do this - if you don't mind zeros showing up in the columns.

    Make a row of headers like [1] [2] [3] [4] ... and then paste use this formula in the area under each header (see attached example, starts in column F).

    =IFERROR((("[" & SUMPRODUCT((LEFT($A$1:$A4,1)="[")*1)&"]")=F$4)*$B5,0)


    OR, if you want to not show the 0's use this: (starts in the M column)
    =IF(IFERROR((("[" & SUMPRODUCT((LEFT($A$1:$A4,1)="[")*1)&"]")=M$4)*$B5,0)>0,$B5,"")


    Which you use depends on what you would do afterwards - if you need each cell to work as a number afterwards, leave the 0's. BTW, Column D just shows what the sumproduct() part of the function does for you - you don't need that column there, I just left it for eductational purposes. :D
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-22-2011
    Location
    Long Beach CA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: trying to create a dynamic range based on column A cell value...index match?

    This is perfect, thank you.

+ 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 list of Cell Data (column B) based on value in same row, dynamic column.
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-03-2013, 03:27 AM
  2. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  3. [SOLVED] Dynamic Name Range using Offset&Match with Match based off a different column
    By mdlpjr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-16-2013, 06:33 PM
  4. using offset function to create dynamic range based on a match search
    By freddiethomas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-08-2013, 05:34 AM
  5. using offset function to create dynamic range based on a match search
    By freddiethomas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2013, 04:14 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