+ Reply to Thread
Results 1 to 4 of 4

Dynamic Range Formula or Non Contiguous Single Column Based on Value of 2nd Column?

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Dynamic Range Formula or Non Contiguous Single Column Based on Value of 2nd Column?

    After trying a few options and searching for the last couple hours can't seem to find a way to have a dynamic named range that will select the cells in Column B if the corresponding value in Column A is equal to a specific value ("Y"). Any info on how I could accomplish this is appreciated. FYI, I am generating the dynamic named range specifically to identify cells to clear the values from in a macro. Thanks.

    Cross Post on MrExcel
    Last edited by drew.j.harrison; 03-13-2019 at 07:57 AM. Reason: Add note that I am looking to generate a named range.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Dynamic Range Formula or Non Contiguous Single Column Based on Value of 2nd Column?

    Assuming data starts on row 1

    in C1
    =IFERROR(INDEX($B$1:$B$1000,AGGREGATE(15,6,ROW($B$1:$B$1000)/(($A$1:$A$="Y")),ROWS(A$1:A1))-(1-1),1),"")
    and copy down the column

    Change the red 1s to whatever row the data starts on
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Re: Dynamic Range Formula or Non Contiguous Single Column Based on Value of 2nd Column?

    Quote Originally Posted by Special-K View Post
    Assuming data starts on row 1

    in C1
    =IFERROR(INDEX($B$1:$B$1000,AGGREGATE(15,6,ROW($B$1:$B$1000)/(($A$1:$A$="Y")),ROWS(A$1:A1))-(1-1),1),"")
    and copy down the column

    Change the red 1s to whatever row the data starts on

    What you posted definitely works to generate an actual dynamic contiguous range which lists all of the values that meet the criteria with one minor typo correction:

    =IFERROR(INDEX($B$1:$B$1000,AGGREGATE(15,6,ROW($B$1:$B$1000)/(($A$1:$A$1000="Y")),ROWS(A$1:A1))-(1-1),1),"")

    However, I should have been more clear in my original post. I am actually looking to generate a Dynamic NAMED Range that will simply select the cells. I then intend to reference this dynamic named range in a macro to delete the data. Sorry about the confusion.
    Last edited by drew.j.harrison; 03-13-2019 at 07:56 AM.

  4. #4
    Registered User
    Join Date
    03-07-2011
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003, 2007, & 2010
    Posts
    52

    Re: Dynamic Range Formula or Non Contiguous Single Column Based on Value of 2nd Column?

    I am also open to using VBA to select the range and delete the cells if necessary. Was just hoping I could use a Dynamic Named Range to reduce the risk of having to go back and modify the macro if I change the table layout in the future.

+ 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. Need to define dynamic range for column I to K based on dynamic column A
    By flabb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2015, 10:19 AM
  2. [SOLVED] Dynamic List From Single Column of Named Range Table (Permit Open/Close Bracket)
    By BoardGuy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2014, 09:41 AM
  3. MACRO to transform single column to multiple columns, based in dynamic values
    By gaqueiroz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2012, 01:54 PM
  4. Retaining proper pivot header of dynamic single column range
    By VTHokie11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2011, 03:03 PM
  5. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  6. Replies: 0
    Last Post: 02-28-2006, 09:10 PM
  7. Replies: 0
    Last Post: 02-28-2006, 09:10 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