+ Reply to Thread
Results 1 to 13 of 13

Pull in data based on certain values

  1. #1
    Registered User
    Join Date
    05-29-2014
    Posts
    3

    Exclamation Pull in data based on certain values

    Hi,

    I have a major data project to complete and I remember there being a short cut to the finish line. I just can't seem to remember how. In the attached document you will find a sample spreadsheet with the full question being on page 3. If anyone could help me, I would truly appreciate it. It's very difficult and maybe cannot even be done, but I am just hoping for the best. Thank you!
    Attached Files Attached Files
    Last edited by FDibbins; 05-29-2014 at 05:14 PM.

  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
    53,050

    Re: Complicated Excell Function

    Hi and welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Edit: I have your answer ready and waiting
    Last edited by FDibbins; 05-29-2014 at 04:05 PM.
    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
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Complicated Excell Function

    @ joemand: pls do what FDibbins ask You to do, because I want ot see his solution (and want to compare)...
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  4. #4
    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
    53,050

    Re: Pull in data based on certain values

    OP is off-line now, and I may lose/forget what I worked out lol So I have changed the title. Try this, copied down...
    =IFERROR(INDEX(Sheet2!$B$2:$B$25,MATCH(Sheet1!$A2,Sheet2!$A$2:$A$25,0)+1),"No Match")

  5. #5
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Pull in data based on certain values

    hm... looks good but the last line is not correct I think (see item '1015KRRB3-LAME').
    Is it possible to manage this kind of situation via regular (not in VBA created) formulas?

  6. #6
    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
    53,050

    Re: Pull in data based on certain values

    hmm actually thats not the only 1 that is not correct. I based that on all "red" parts on sheet 2 having 2 rows each. Where there is only 1 row for the part, the formula fails. I think I can makwe a work-around though. (that was a regular formula, not VBA creates, btw)

  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
    53,050

    Re: Pull in data based on certain values

    OK try this...
    =IFERROR(INDEX(Sheet2!$B$2:$B$25,MATCH(Sheet1!$A2,Sheet2!$A$2:$A$25,0)+IF(INDEX(Sheet2!$A$2:$A$25,MATCH(Sheet1!$A2,Sheet2!$A$2:$A$25,0)+1)="",1,0)),"No Match")

  8. #8
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Pull in data based on certain values



    nice & working...
    (there is always something to learn)

  9. #9
    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
    53,050

    Re: Pull in data based on certain values

    @ M.R. Thanks for the catch on that, and thanks for the rep Hopefully, this is what the OP wanted too

  10. #10
    Registered User
    Join Date
    05-29-2014
    Posts
    3

    Re: Pull in data based on certain values

    Quote Originally Posted by FDibbins View Post
    @ M.R. Thanks for the catch on that, and thanks for the rep Hopefully, this is what the OP wanted too
    Hi FDibbins, I must first say that I am dazzled by your work. With that being said, I also must thank you deeply. I was going to have to have to hand type this data into nearly 1,100 different rows.

    However, I do have a few questions. If you look at Sheet 2, you may notice that there are pairs of data separated by borders. For example, row 2-3 or 4-5 or 6-7, etc. Then you may notice that some of these pairs for Red Company are completed filled (i.e. row 12-13) while most others are not (i.e. 2-3). This is because they sometimes only offer the PRM and not the LAME, but sometimes offer both. Blue company typically only offers Bad, and rarely Nice and Bad.

    Typically you will have rows such as 1-2 where Red lists a PRM and in column Blue it offers a Bad underneath in row 2. Although, there are certain situations like rows 12-13 where Red Company list the LAME part and then the PRM part underneath. But in the column next to it Bad is labeled in Row 12, rather than under PRM. Which is why in sheet 1 it is displaying a N/A in Blue rather than "09067".

    Does this make sense or am I just twisting this? I'm awfully sorry and I would again appreciate the help. Nevertheless, I love what you've already helped me with. Thank you.

  11. #11
    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
    53,050

    Re: Pull in data based on certain values

    Thanks for the kind words, always appreciated

    OK I kinda get what you are saying, but Im not sure what you are asking Perhaps, if you provided a few sample answers (entered manually if needed)?

  12. #12
    Registered User
    Join Date
    05-29-2014
    Posts
    3

    Re: Pull in data based on certain values

    Haha, understandable. In the attached document you will find that I manually edited the Excel Sheet and color coded it to correspond with page 2. It compares your formula with what had to be manually typed in. Basically, not all the data is being pulled correctly.
    Attached Files Attached Files

  13. #13
    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
    53,050

    Re: Pull in data based on certain values

    OK try this monster in B4...
    =IFERROR(IF(LEFT(INDEX(Sheet2!$A$2:$A$25,MATCH(Sheet1!$A4,Sheet2!$A$2:$A$25,0)),5)=INDEX(Sheet2!$A$2:$A$25,MATCH(Sheet1!$A4,Sheet2!$A$2:$A$25,0)-1),INDEX(Sheet2!$A$2:$A$25,MATCH(Sheet1!$A4,Sheet2!$A$2:$A$25,0)-1),
    INDEX(Sheet2!$B$2:$B$25,MATCH(Sheet1!$A4,Sheet2!$A$2:$A$25,0)+IF(
    INDEX(Sheet2!$A$2:$A$25,MATCH(Sheet1!$A4,Sheet2!$A$2:$A$25,0)+1)="",1,0))),"No Match")

  14. #14
    Registered User
    Join Date
    05-29-2014
    Posts
    3

    Re: Pull in data based on certain values

    Haha, yes thank you. Showed the final result during a conference meeting and all of the bosses were shocked that I had solved it so soon. You my friend have a strong talent. Thank's again!

+ 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. Complicated IF function with example
    By ruthyeh in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2013, 06:40 PM
  2. Complicated IF function
    By ruthyeh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2013, 10:59 AM
  3. Help with a complicated IF function
    By este994 in forum Excel General
    Replies: 17
    Last Post: 04-20-2011, 07:10 AM
  4. Complicated function; Can it be done?
    By The Boy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-30-2007, 08:10 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