+ Reply to Thread
Results 1 to 3 of 3

Extract Data_Under certain Criteria

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Extract Data_Under certain Criteria

    Hii!

    I need a vba code to extract all of the dates that contain a "Yes" but also extract the complete list of dates.
    See that only the 3-Jan-11 is repeated because it contains 2 "Yes". If it contains 3 "Yes" it will be repeated one more time and so on with all of the dates.

    Sometimes the date not contain a Yes or No.

    Here is an example:

    Original Data:

    2-Jan-11 Yes
    3-Jan-11 Yes
    3-Jan-11 No
    3-Jan-11 Yes
    4-Jan-11 No
    5-Jan-11 No
    5-Jan-11 Yes
    6-Jan-11 No
    7-Jan-11
    Extract Data:

    2-Jan-11
    3-Jan-11
    3-Jan-11
    4-Jan-11
    5-Jan-11
    6-Jan-11
    7-Jan-11

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Extract Data_Under certain Criteria

    Your question is not very clear. Can you try explaining with some more details?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    09-24-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Extract Data_Under certain Criteria

    Hii

    I need to extract all of the dates from a list of dates. But if a Date contains a Yes in the second column, duplicate it if is more than one Yes like the 3-Jan-11.

    Or you can see in another way: Extract all of the dates that contains a "Yes" in the second column, but also includes only one time all of those dates that contains a "No" or a blank.

    In the next example I extract all of the dates, but the 3-Jan-11 is duplicated because it contains two "Yes". Did you understand more now? Let me know.

    2-Jan-11 Yes
    3-Jan-11 Yes
    3-Jan-11 No
    3-Jan-11 Yes
    4-Jan-11 No
    5-Jan-11 No
    5-Jan-11 Yes
    6-Jan-11 No
    7-Jan-11
    Extract Data:

    2-Jan-11
    3-Jan-11
    3-Jan-11
    4-Jan-11
    5-Jan-11
    6-Jan-11
    7-Jan-11

    I have this code, but it only counts the dates that have a "Yes".
    Please Login or Register  to view this content.
    Last edited by arlu1201; 10-26-2012 at 03:45 AM. Reason: Replaced formula tags with code tags.

+ 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