+ Reply to Thread
Results 1 to 8 of 8

If Statement - to copy complete row based a criteria of one cell in row

  1. #1
    Registered User
    Join Date
    07-29-2009
    Location
    Suffolk, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    If Statement - to copy complete row based a criteria of one cell in row

    Hi There,

    I have a list of data, each row has a status of new and old.

    I need two new worksheets - one to display all rows with a status of new and the other with all rows with a status of old.

    The master sheet will keep being added to and status' updated so I will need to formula to keep updating periodically.

    Please see example spreadsheet attached - I have manually completed the 'All New' sheet, which I need to be auto.

    Thanks in advance. Chloe.
    Attached Files Attached Files

  2. #2
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If Statement - to copy complete row based a criteria of one cell in row

    In A2 of "AllNew" sheet, put this ARRAY formula. Copy down and across. Same way for the other sheet.

    =IFERROR(INDEX(Master!A$2:A$1000,SMALL(IF(Master!$B$2:$B$1000="New",ROW(Master!A$2:A$1000)-1),ROW(Master!A1))),"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    07-29-2009
    Location
    Suffolk, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: If Statement - to copy complete row based a criteria of one cell in row

    Thank you, however when I drag the formula down and across it doesn't give any results.

    Thanks, Chloe

  4. #4
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If Statement - to copy complete row based a criteria of one cell in row

    It's because you don't confirm as an ARRAY formula. See my Signature for ARRAY formulas.

  5. #5
    Registered User
    Join Date
    07-29-2009
    Location
    Suffolk, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: If Statement - to copy complete row based a criteria of one cell in row

    Thank you, and apologies I did not see this.

    I have copied the formula to my actual spreadsheet (Active Sheet, Column A), but it appears to be giving me records it should not. Could you please have a look at the attached for me - You will see in the references start at 3 - it should be 1 - and the list includes records with a status of Cancelled, when it should only show Active.

    Thanks, Chloe
    Attached Files Attached Files

  6. #6
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    Excel 2003,2007,2010,2013
    Posts
    1,914

    Re: If Statement - to copy complete row based a criteria of one cell in row

    Hi chloe.snowling

    In A2 copy across and down, on the sheet "All New":
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And for the sheet "All Old":
    =IFERROR(INDEX(Master!A$2:A$11,AGGREGATE(15,6,ROW(Master!$2:$11)-ROW(Master!$1:$1)/(Master!$B$2:$B$11="Old"),ROW($A1))),"")

    Just enter the formula as normal (Non array formula)
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  7. #7
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If Statement - to copy complete row based a criteria of one cell in row

    You need to change the red part of the formula.

    =IFERROR(INDEX(Master[New Index],SMALL(IF(Master[Record Status NEW]="Active",ROW(Master[New Index])-2),ROW(Master!B1))),"")

  8. #8
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    Excel 2003,2007,2010,2013
    Posts
    1,914

    Re: If Statement - to copy complete row based a criteria of one cell in row

    Hi

    As you are using excel 2010, you can use the Aggregate function (Non Array)
    InA4 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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