+ Reply to Thread
Results 1 to 9 of 9

Extract data based on table of conditions

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Extract data based on table of conditions

    Hello everyone
    I have data in sheet1 in range("B3:C14") in two columns one for code and the other for date

    Based on the table in range("F1:I2") I need to extract data to another sheet ..based on the code number in F2 & G2 in the period between the two dates in H2 & I2
    There is the expected output to illustrate my need and if possible to format the output ..
    Thanks advanced
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  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,929

    Re: Extract data based on table of conditions

    I did this with a very simple Pivot Table...
    J
    K
    L
    4
    Row Labels
    5
    1
    6
    1-Jan
    7
    2-Jan
    8
    4-Jan
    9
    2
    10
    2-Jan
    11
    3-Jan
    12
    6-Jan
    13
    3
    14
    5-Jan
    15
    6-Jan
    16
    Grand Total
    17


    Use both Code and then Date as row labels
    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
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Extract data based on table of conditions

    Thanks a lot for reply
    But I need the output to be between two dates..
    In fact I prefer coding as I need the output to be formatted like attached

  4. #4
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Extract data based on table of conditions

    Try this...sorry, took longer than I thought:

    Please Login or Register  to view this content.
    Want to show appreciation for the help you received from a member? Give them reps by clicking the bottom left of their post!

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Extract data based on table of conditions

    Maybe :

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Extract data based on table of conditions

    Thanks a lot Mr. Obsessed for this helpful solution..It's great
    Mr. Karedog
    I tested the code and I got an error (Method 'Union' of object'_Global failed) at this line
    Please Login or Register  to view this content.
    Thanks a lot for offering help

  7. #7
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Extract data based on table of conditions

    Sorry, forget the dot :

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Extract data based on table of conditions

    Never mind at all Mr. Karedog
    It's my fault not yours .. I have to correct this simple error on my own
    Now It is VERY PERFECT
    Thank you very very much

    Many thanks too to Mr. Obsessed for his great solution

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Extract data based on table of conditions

    You are welcome, it is my fault not yours


    Regards

+ 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. Replies: 2
    Last Post: 10-16-2014, 11:35 AM
  2. [SOLVED] Need to return data from a table based on multiple conditions
    By skayem in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-27-2014, 11:12 AM
  3. Extract data based on month/year to a simple table.
    By maax555 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-15-2014, 09:55 AM
  4. Extract the data to another sheet based on variable conditions
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-25-2014, 06:10 PM
  5. Extract Data based on conditions on multiple columns
    By checkoncomp in forum Excel General
    Replies: 6
    Last Post: 07-03-2013, 01:54 PM
  6. Replies: 2
    Last Post: 06-01-2012, 09:24 AM
  7. Moving data from a pivot table to another table based on conditions
    By MarinaDBrown in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2009, 12:11 PM

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