+ Reply to Thread
Results 1 to 7 of 7

Help creating a formula to pull data from one sheet into another

  1. #1
    Registered User
    Join Date
    07-23-2014
    Location
    USA
    MS-Off Ver
    Windows 7
    Posts
    23

    Help creating a formula to pull data from one sheet into another

    I have two sheets with data that I need to merge into one. The first sheet has three rows and the other sheet has several rows. I need to pull data from the second sheet 4th column if the value in the third column is authorization_date and the last column is not null into the first sheet after the last used column. Then I need to pull data from the second sheet 4th column if the value in the third column is decision_sent_date and the last column is not null.
    If there are more rows in the second sheet than the first then I need to have the row where column E or Gin the first sheet is less that the value for the authorization_date or decision_sent_date duplicated to accommodate the extra values for authorization_date and/or decision_sent_date...an example of this duplicate row is shown the first data row in the End Results tab in the attached workbook. I tried

    Thanks for any assistance with this is appreciated.
    Seeki
    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,968

    Re: Help creating a formula to pull data from one sheet into another

    Hi, welcome to the forum

    This pulls out what you want...
    =INDEX(TableB!$D$3:$D$18,MATCH(A3&"-"&B3&"-"&"Authorization_Date",INDEX(TableB!$A$3:$A$18&"-"&TableB!$B$3:$B$18&"-"&TableB!$C$3:$C$18,0),0))

    However, because field1 and field2 are the same in both tables, we need something to create unique ID's?

    An alternative would be this ARRAY formula...
    =INDEX(TableB!$D$3:$D$18,SMALL(IF(TableB!$A$3:$A$18=A3,ROW(TableB!$A$3:$A$18)-2),ROWS($A$1:A1)))
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    However, the answers from that, apart from the 1st 1, dont match yours?
    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
    07-23-2014
    Location
    USA
    MS-Off Ver
    Windows 7
    Posts
    23

    Re: Help creating a formula to pull data from one sheet into another

    FDibbins,

    Thanks for responding and assisting me, appreciate the help. The first formula returns the first date on all three rows for authorization. The second formula works for the authorization date if I delete the records with null from Table B; but does not return expected results for the decision_sent_date - in this case it returns the first date twice and then the second date. The results are as follows:

    2014-01-21 07:57:50.343 2014-01-07 17:08:19 870
    2014-02-21 09:45:20.043 2014-01-07 17:08:19 870
    2014-07-21 08:05:07.243 2014-01-21 08:21:40.970

    I can get both to return the correct values when there are no duplicates/multiples using vlookup with a concatenation of the first two column in column A and separating the authorization and decision sent into two sheets (auth and sent) as follows:

    =VLOOKUP(A2,auth!$A$1:$A$5407,5,0)
    =VLOOKUP(A2,sent!$A$1:$A$5237,5,0)

    When there are multiple decision I need to show that but duplication the row from Table A that the multiple authorizations and or decisions apply to....this is where I cant get it to work how I need it to work.

    Thanks again, I appreciate you trying to help me!

  4. #4
    Registered User
    Join Date
    07-23-2014
    Location
    USA
    MS-Off Ver
    Windows 7
    Posts
    23

    Re: Help creating a formula to pull data from one sheet into another

    I got it to work and display the 3 lines for both, I realized I started the decision sent date on the wrong row, once I made that correction it works perfectly for the single matches...but not for multiple matches. So it give the same results as using the vLookup ....both index match and VLOOKUP using separate sheets for authorization date and decision sent date yield the same results....and neither works for multiple so I need a way to insert the row(s) to accommodate multiples.

    Thanks again
    Seeki

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

    Re: Help creating a formula to pull data from one sheet into another

    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.

  6. #6
    Registered User
    Join Date
    07-23-2014
    Location
    USA
    MS-Off Ver
    Windows 7
    Posts
    23

    Re: Help creating a formula to pull data from one sheet into another

    Thanks for the suggestions. I am not ready to mark this as solved just yet as I am still trying to work through the multiple matches... and how to insert the row when the table B has more rows for a record than table A ... I am working on logic to get the difference between Table a record and table B and use that in an If statement
    Right now I am using offset to eliminate the fist record to get just the three rows...but ideally I want to keep all rows form table B and do the insert of extra row(s) for the record on table A.

    Thanks again

  7. #7
    Registered User
    Join Date
    07-23-2014
    Location
    USA
    MS-Off Ver
    Windows 7
    Posts
    23

    Re: Help creating a formula to pull data from one sheet into another

    We manually worked the sheet as we found no way to automate what we needed.

+ 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. Formula to pull data from one sheet to a new sheet based on date range
    By lisajolley11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2015, 08:38 PM
  2. [SOLVED] VBA formula with multiple variables to pull data from spread sheet.
    By topnotchthrillr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2015, 12:30 AM
  3. Need formula to pull data from one sheet to another
    By darkfeld in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-17-2014, 12:25 AM
  4. [SOLVED] Formula to pull data from one sheet and column for another sheet.
    By Dena in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2013, 06:20 PM
  5. Creating a Macro that will automatically pull data from a new spreed sheet.
    By btm88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2013, 05:23 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