+ Reply to Thread
Results 1 to 7 of 7

Formula to Exclude lines that dont match criteria

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    uk
    MS-Off Ver
    Excel 2013, 365
    Posts
    20

    Formula to Exclude lines that dont match criteria

    Hi,

    I have a spread sheet that has a master visit planner on sheet 1 and then monthly sheets. I have entered formulas to extract the monthly data but cannot figure out how to exclude lines that do not meet the criteria.

    I've attached a sample sheet which hoperfully makes things a little clearer.

    Thanks in anticipation of your help

    Chris
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2013
    Posts
    32

    Re: Formula to Exclude lines that dont match criteria

    Hi Chris,

    Had a quick look at your sheet. Could you please clarify what you mean by 'exclude lines'

    Gregg

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    uk
    MS-Off Ver
    Excel 2013, 365
    Posts
    20

    Re: Formula to Exclude lines that dont match criteria

    Hi Gregg,

    I would like each month to list just those lines that belong to it...ie no gaps..

    Thanks

    Chris

  4. #4
    Registered User
    Join Date
    11-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2013
    Posts
    32

    Re: Formula to Exclude lines that dont match criteria

    I'm a VBA novice, but this recorded macro works.
    I've added a button you can click to run.

    If you want to add further sheets, with other month names. You'll need to expand the macro.

    Gregg
    Attached Files Attached Files

  5. #5
    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,926

    Re: Formula to Exclude lines that dont match criteria

    Hi and welcome to the forum

    Here are other options that dont use VBA...
    1. On the month sheets, apply filters and filter out all blank rows

    2. in L:N (expand as needed for extra months), copy this down...
    =IF(I2="",MAX($L$1:L1),MAX($L$1:L1)+1)

    Then in Jul - Aug sheets use this, copied across and down...
    =IFERROR(INDEX('Visit Schedules'!$A:$H,MATCH(ROW(A1),'Visit Schedules'!$L:$L,0),MATCH(Jul!B$1,'Visit Schedules'!$A$1:$H$1,0)),"")

    Note: All headings have to be identical on each sheet for this to work (I dont see "Whs-code" on the 1st sheet?)
    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

  6. #6
    Registered User
    Join Date
    06-26-2013
    Location
    uk
    MS-Off Ver
    Excel 2013, 365
    Posts
    20

    Re: Formula to Exclude lines that dont match criteria

    Hi

    Thanks Greg, work a treat and I appreciate your time and effort very many thanks.

    FDibbins, thanks for your efforts also, had to make a couple of modifications to make your formulas work as I wanted but wouldn't have got far without your input also.

    Thanks to both again, top notch stuff

    Chris

  7. #7
    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,926

    Re: Formula to Exclude lines that dont match criteria

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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