+ Reply to Thread
Results 1 to 2 of 2

Extract formula text

Hybrid View

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Aurora, Coloardo
    MS-Off Ver
    Excel 2010
    Posts
    1

    Extract formula text

    I have a variable range of data of roughly 2000 rows some of which have TRUE in a column and the rest show FALSE. I want to condense the first range and only present the rows with TRUE in the specific column - the other caveat is I would much prefer to do this using formulas instead of VBA.

    One thought I had was to use a VLOOKUP to find the first instance of TRUE for the first row of data - success.
    The next step is for row 2 to find the next instance of TRUE. My thought is to use the same VLOOKUP formula but bump the starting row up to where the first instance was found +1.

    Example:
    =VLOOKUP(TRUE,'Tab name'!A1:B2000,2,FALSE) where Column B contains the row number so that if the first TRUE row is row 96 it will return 96.

    For the second occurance, I need to access both the formula text (=VLOOKUP(TRUE,'Tab name'!A1:B2000,2,FALSE)) and the formula result (96) to build the next formula of:

    =VLOOKUP(TRUE,'Tab name'!A97:B2000,2,FALSE)

    How can I pull both the cell value of "96" AND the formula text of "=VLOOKUP(TRUE,'Tab name'!A1:B2000,2,FALSE)" to build each successive formula?

    Thanks,
    DC

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extract formula text

    One way would be to first add a helper column to the Tab Name tab.

    So in B2:

    =IF(A2=TRUE,COUNT(B$2:B2)+1,"") and copy it down

    Now use formula in summary tab.

    =IFERROR(INDEX('Tab name'!A:A,MATCH(ROWS($A$2:$A2),'Tab name'!$B:$B,0)),"")

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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