+ Reply to Thread
Results 1 to 2 of 2

display all rows when condition is true

  1. #1
    Registered User
    Join Date
    04-09-2009
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    25

    display all rows when condition is true

    I have two main data sources, and i want to get the data from website tab that are not esp tab.
    And the results should display on tab Sheet1 and Sheet2

    please check attached xls. and advise to generate code for it.
    Attached Files Attached Files
    Last edited by lemuel; 12-07-2012 at 04:27 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: display all rows when condition is true

    First I made a key on Sheet1. You can hide this row if you like. It separates those on both website and esp ("WNE") and those only on Website ("WO") and numbers them starting at 0. The formula in Sheet1!A7 copied down is

    =IF(ROW(A1)>COUNTA(website!C:C)-1,"",IF(ISNUMBER(MATCH(website!C2,esp!$B$2:$B$11,0)),"WNE_" &COUNTIF($A$6:A6,"WNE*"),"WO_"&COUNTIF($A$6:A6,"WO*")))

    Then on Sheet1 in B7 dragged across and down
    =IFERROR(INDEX(website!A$2:A$11,MATCH("WO_"&ROW(A1)-1, $A$7:$A$16,0)),"")

    I did something similar on sheet2 except I referenced the key on sheet1 since it was already there
    =IFERROR(INDEX(website!B$2:B$11,MATCH("WNE_"&ROW(A1)-1, Sheet1!$A$7:$A$16,0)),"")

    See attachment
    Does that work for you?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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