+ Reply to Thread
Results 1 to 13 of 13

Copying rows that meet two criteria to another worksheet

  1. #1
    Registered User
    Join Date
    08-28-2013
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    6

    Exclamation Copying rows that meet two criteria to another worksheet

    I am trying to copy entire rows from the first worksheet in a document to another worksheet.

    The desired layout on the second worksheet is that the lowest values from Column A within each of four (4) criteria in Column L are rank ordered (thus the lowest values).

    Column A - rank order priority of the overall spreadsheet (based on criteria summed from other columns) (It is a list of projects placed in priority for funding.)
    Column L - there are four agencies (The four agencies are competing on funding based on the prioritization in Column A.)

    I would like for the "top 5" rows for each of the four agencies listed on the second sheet. The only "requirement" is that the data must be sorted by each agency.

    Any help?

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    If you throw me a sample sheet, I could throw you a collection of formulas using CountIf, Sumproduct, Index, and Match.

    Another option might be to use a macro in conjunction with advanced filter to copy the data you wanted with just a click.

  3. #3
    Registered User
    Join Date
    08-28-2013
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copying rows that meet two criteria to another worksheet

    Let me "dumb down" our chart - sensitive info . . . I'll post in about ten minutes as an attachment.

    Thanks!

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    No problem.

    Here are two examples I've put together for others. It will likely use the same kind of logic.

    AutoSort has a four way breakdown, showing all items.

    The tutorial I wrote shows a three way, with description of code.

    For you, I'd just show 5 returns per item, instead of all.

    Attachment 261445

    Attachment 261446

  5. #5
    Registered User
    Join Date
    08-28-2013
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copying rows that meet two criteria to another worksheet

    Okay, the attachment will work for what I think I need!

    The information should come from the Tab labeled "WOPL" and formatted/copied into Tab labeled "Top 5 By Division".

    I'll keep watching here . . .
    Attached Files Attached Files

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    I love a good challenge.

  7. #7
    Registered User
    Join Date
    08-28-2013
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copying rows that meet two criteria to another worksheet

    Sounds great!! It is a challenge well beyond my limited knowledge of EXCEL!!!

    Thanks for the help in advance!!!

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    I'm at a boring conference. This was way more interesting.

    I've got it almost completely done, just working on preventing errors where there's less than 5 records to return.

    Otherwise, done.

    Attachment 261453

  9. #9
    Registered User
    Join Date
    08-28-2013
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copying rows that meet two criteria to another worksheet

    This looks sweet! My buddy and I are struggling with several other things, but this is killing us!!

    Thanks! Looking forward to the final product!

  10. #10
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    And here's a revised version.

    I updated the formula to leave blanks instead of zeroes for the comments field and others.

    Also created a match formula that will find top five without errors, even if there's only one or two records.

    Attachment 261458

  11. #11
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    Did you need me to adapt this to fit more information?

    I can revise the formulas to accommodate more rows entered on the first page if you need.

  12. #12
    Registered User
    Join Date
    08-28-2013
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copying rows that meet two criteria to another worksheet

    Nope! Looks great!!! And fills the need perfectly for what we are doing!

    Just know that you are a star in this office right now!!

    We owe you a beer if you ever get to Colorado Springs . . . Hell, we owe you a case!

    Thanks!

  13. #13
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Copying rows that meet two criteria to another worksheet

    Hahaha!

    Thank you, glad I could help. It kept me awake and I learned something new (the weird countif workaround I used for the top five or less records was new to me).

    Please mark the thread as solved at the top if you think this case is solved so other people can reference it in the future.

    Feel free to let me know if you have any other questions. Everything is possible.
    Last edited by daffodil11; 08-28-2013 at 05:02 PM.

+ 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. Copying Rows that meet criteria/criterion
    By protoking17 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-06-2013, 09:27 AM
  2. Replies: 1
    Last Post: 01-29-2013, 09:31 AM
  3. Move rows to different worksheet that meet certain criteria
    By pstritt in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-25-2013, 02:50 PM
  4. Copying all rows that meet a criteria to another worksheet
    By nzkazza in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-19-2012, 05:53 AM
  5. Finding and copying rows that meet key word criteria
    By acrobaticgod in forum Excel General
    Replies: 12
    Last Post: 10-29-2011, 05:35 PM

Tags for this Thread

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