+ Reply to Thread
Results 1 to 6 of 6

How to pull data from one sheet into new sheet based on two criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    07-21-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    How to pull data from one sheet into new sheet based on two criteria

    Hello,

    I receive a report that gives me the depreciation amount for the rest of the year based on dates. Each month it changes to how many months are left in the year.

    I want to rearrange this data dump into an organized chart that shows each month depreciation by account.

    Example:

    Sheet 1:
    Code Date Depreciation Amt
    A 1-July 2000
    A 1-Aug 2000
    A 1-Sep 2000
    A 1-Oct 2000
    A 1-Nov 2000
    A 1-Dec 2000

    B 1-July 1000
    B 1-Aug 1000
    B 1-Sep 1000
    B 1-Oct 1000
    B 1-Nov 1000
    B 1-Dec 1000


    Sheet 2:
    Jan Feb Ma Apr May Jun Jul Aug Sep Oct Nov Dec Total
    A - - - - - - 2000 2000 2000 2000 2000 2000 12,000
    B - - - - - - 1000 1000 1000 1000 1000 1000 6,000




    Thank you

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to pull data from one sheet into new sheet based on two criteria

    I think you don;t need to rearange your data if the question is only to make a chart of the data.

    You can also make a chart in which the data is vertical structured.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    07-21-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: How to pull data from one sheet into new sheet based on two criteria

    the thing is. is that the first sheet is imported from a text document.

    it doesn't have the label "a" for each amount. I manually filled it in.

    I guess what I'm asking is how can I autofill based on the number of months are left in the year to label each month as "a" or "b"

    from there I use a vlookup funtion to create a chart for sheet 2.

    i want to know if there's a way that i can just create the chart from the data, or a way in vba to autofill down (based on the number of month) the label, then use a vlookup for sheet 2.

    thanks again for replying!

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to pull data from one sheet into new sheet based on two criteria

    In that case it's time to post an excel file, without condentional information, how your data looks like.

    Please also add the desired (expected) result in your file.

  5. #5
    Registered User
    Join Date
    07-21-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: How to pull data from one sheet into new sheet based on two criteria

    ive attached the file thnx!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How to pull data from one sheet into new sheet based on two criteria

    I run the macro below to delete the blanc cells in column B an to fill data in column A.

    After that I made a pivot table (verticaly)

    After that I made a graph of it.

    See the attached file.

    Sub delete_blanc_cells_in_column_B_and_filldata_in_column_A()
    
    
     With Sheets("Projection")
        
       .Rows(6).EntireRow.Delete
       .Range("b1:b" & .Rows.Count).SpecialCells(4).EntireRow.Delete
      
        End With
        
    'filldata_acending_incolumnA()
    
    'from top to below (acending)
    
        Range(Range("a2"), Cells(Rows.Count, 3).End(xlUp).Offset(, -2)). _
            SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
        With Columns("a")
            .Value = .Value
        End With
        
       
        
    End Sub
    Attached Files Attached Files
    Last edited by oeldere; 07-23-2013 at 01:21 PM. Reason: text

+ 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. Pull data from one sheet to another based on criteria
    By lowrymike in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2013, 12:53 PM
  2. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  3. Replies: 4
    Last Post: 08-29-2012, 10:32 AM
  4. Pull data from one sheet to another using multiple criteria
    By Farhaad Saleh in forum Excel General
    Replies: 5
    Last Post: 07-22-2011, 10:32 AM
  5. Pull data from another sheet based on certain criteria
    By steve_sr2 in forum Excel General
    Replies: 1
    Last Post: 02-23-2006, 06:15 AM

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