+ Reply to Thread
Results 1 to 9 of 9

advanced filtering issues

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    advanced filtering issues

    I have a problem when filtering.

    I have three sheets in my workbook: Before Filter, After Filter, and Sheet1
    Before Filter is the main data, After Filter is the data after its been filtered and Sheet 1 must run off the filtered data.

    Problem:
    When I filter the data, the row numbers change when filtered. What I mean is, when Excel filters the data it keeps the original row number on the left and doesn't move the filtered data up to row2 it just shows the original row number. So when I try to grab the data in Sheet1 it gives me all the data in its corresponding rows not just the filtered data.

    What I need to do:
    In the attached example, I need the data from, what should be A2, in the After Filter sheet to show in A1 of Sheet1, without making a direct reference to the row number that is shown in the second row in the After Filter sheet, and so on down the rows.

    Can this be done without using Macros?
    Please provide code examples in your replies.
    Thanks
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: advanced filtering issues

    I will take a look at your file, but just to let you know...filtering does NOT move things around, all it does is hide rows that do not meet certain crierta
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    02-13-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: advanced filtering issues

    That's what I thought filtering did but I wan't sure.

    Due to confidentiality I cannot post my whole project so I have been trying to ask the right questions to get done what I need to do. My project is a calendar that shows data in different rows due to specific criteria. I have been trying to filter down the data to individual tables to fill each row in the calendar from the desired table so I need to have consistent row numbers in the filtered tables. This calendar will be run everyday and will have different data everyday so I'm not sure how I will fill the calendar if I cannot directly reference A2, A3, A4, etc. because currently cells A2, A3, A4, etc. in the filtered table(even if not shown on the table) may or may not have the data I require. I hope this gives you a better understanding of what I am trying to accomplish.

    Thanks for your help again today FDibbins!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: advanced filtering issues

    Assuming that your WO number will be unique, try this on sheet1, copied down...

    =IFERROR(INDEX(OFFSET(INDEX('Before Filter'!$C$2:$C$27, MATCH('Before Filter'!$L$2,'Before Filter'!$O$2:$O$27, 0)),,, COUNTIF('Before Filter'!$O$2:$O$27, 'Before Filter'!$L$2), ), ROW('Before Filter'!A1)), "")
    it is an array formula and must be entered using CTRL SHIFT enter, not just enter

    This will pull out all the WO Numbers that are TRUE in column O (8)
    You can then use vlookup or index/match to pull in the rest of the data

  5. #5
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: advanced filtering issues

    A slightly different approach
    use this ARRAY Formula (Cntrl+Shift+Enter,not just Enter) in A2 of a new sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag across and down
    the ranges would have to be adjusted for the size of your actual data, I limited it to row 50 to keep file size small enough to upload
    The attached shows the results of your filtered output, to get the data based on a different criteria, change the red range above

    Hope this helps
    Attached Files Attached Files
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  6. #6
    Registered User
    Join Date
    02-13-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: advanced filtering issues

    I put the following statement into Sheet1 A1 and initialized it with CTRL+SHIFT+ENTER.
    =IFERROR(INDEX(OFFSET(INDEX('Before Filter'!$C$2:$C$27, MATCH(TRUE,'Before Filter'!$O$2:$O$27,0)),,, COUNTIF('Before Filter'!$O$2:$O$27, TRUE), ), ROW('Before Filter'!A1)), "")

    I changed the $L$2 references to TRUE because L2 may or may not be TRUE.
    The output only gave me the first WO that was TRUE in A1 no other work orders were shown.
    How do I get the rest of the WO numbers in subsequent rows into Sheet1?

  7. #7
    Registered User
    Join Date
    02-13-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: advanced filtering issues

    =IFERROR(INDEX('Before Filter'!$A$2:$V$50,SMALL(IF(('Before Filter'!$O$2:$O$50=TRUE),ROW('Before Filter'!$A$2:$A$50)-ROW('Before Filter'!$A$2)+1,""),ROW($A1)),COLUMN()),"")

    This code gives me the first date that shows TRUE in column O but still only shows the first date.
    How do I show the rest of them on subsequent rows in Sheet1?
    Last edited by derrickh13; 02-15-2013 at 02:47 PM.

  8. #8
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: advanced filtering issues

    Make sure you array enter it, (Cntrl+Shift+Enter), then drag the formula down...on the example I uploaded, sheet 'FormulaFilter8isTrue', the green area shows this

    Edit-
    Down and Across actually
    Last edited by dredwolf; 02-15-2013 at 03:12 PM.

  9. #9
    Registered User
    Join Date
    02-13-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: advanced filtering issues

    Thanks for your help guys!
    I used dredwolf's function since it shows all the data for each row and not just the WO #.
    Once I pasted the code into A2 then I had to drag and highlight the extra cells to show all the data.

    Thanks for your help on this!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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