+ Reply to Thread
Results 1 to 12 of 12

Need a formula to make Excel search for info

  1. #1
    Registered User
    Join Date
    10-12-2011
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    3

    Need a formula to make Excel search for info

    Please help! This would save me HOURS AND HOURS of work!

    I need a formula to make Excel search columns C-E (all rows) of worksheet 1 for data contained in columns A-C of worksheet 2. If matching data is found, I want it to insert the data from column J worksheet 2 (same row as A-C) into column G of worksheet 1. I need to be able to apply the formula to each row, columns will remain the same.

    Is this possible? I hope it makes sense, this is WAY beyond my Excel knowledge!

    See attached for the worksheets.

    Thanks in advance!

    Melissa
    Attached Files Attached Files
    Last edited by Memzzie; 10-14-2011 at 07:51 AM. Reason: SOLVED

  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: SO confused, please help!

    First of all, please change your heading to something that explains your problem.
    2nd - Please attach a sample workbook.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: SO confused, please help!

    Hi Memzie, welcome to the forum.

    You do need to not be so frantic in your posts, ok? You'll surely get help here fast and easy if simply ask your questions, that's why we're here.

    First, EDIT your post #1 above, click GO ADVANCED and correct your thread title. As per Forum Rules, you must give your thread an accurate title. (Read the rules by clicking the link above in the menu bar.)


    Secondly, it's simplest to show us what you mean. Click GO ADVANCED in the Quick Reply box below and use the paperclip icon to post up a copy of your workbook. In the sample workbook manually mockup some desired results so we can see what you're after.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Thumbs up Re: SO confused, please help!

    you want to do a gigantic FindNReplace right? test this out. To run the macro, press alt+F8 and select & run FNR_Test.
    Last edited by NBVC; 10-12-2011 at 03:11 PM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Need a formula to make Excel search for info

    Please review the attached workbook.

    This formula goes into Worksheet 1, G2

    =INDEX('Worksheet 2'!A:J,MATCH('Worksheet 1'!C2&'Worksheet 1'!D2&'Worksheet 1'!E2,'Worksheet 2'!A:A&'Worksheet 2'!B:B&'Worksheet 2'!C:C,0),10)

    Note that this is an array formula (do a Google search for what that means). This formula must be confirmed by CTRL+SHIFT+ENTER, rather than just ENTER.

    Then just copy on down and you are good to go.
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need a formula to make Excel search for info

    Whizbang, you can't do whole-column array formulas in xl2003 without getting #NUM errors. At least I've never been able to and your sheet does it for me to if I try to reconfirm your formulas as is.

    I'm a little more low-tech. Add a column to your ws2 to create a unique "key" from the 3 elements you want to match. Then use that key in a "match" function on ws1. See attached.
    Attached Files Attached Files

  7. #7
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Need a formula to make Excel search for info

    You're right, of course. I had forgot about that.

    =INDEX('Worksheet 2'!A1:J65536,MATCH('Worksheet 1'!C2&'Worksheet 1'!D2&'Worksheet 1'!E2,'Worksheet 2'!A1:A65536&'Worksheet 2'!B1:B65536&'Worksheet 2'!C1:C65536,0),10)

    Memzzie,
    JBeaucaire's solution is the best if you have many hundreds or thousands of rows. Array formulas are nice because the don't need helper columns, but they can slow down your worsheet if overused.

  8. #8
    Registered User
    Join Date
    10-12-2011
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need a formula to make Excel search for info

    Thank you for your replies everyone, it's looking like it's going to work. My only problem now is that I had to send you a sample spreadsheet of course, not my actual spreadsheet. I thought I had sent a close enough sample, but my original has 60 worksheets and are not named Worksheet 1, 2 and so on. I thought I could make the alterations neccesary to match name for name and cell for cell, but it's just not working.

    Let me give you the exact names of 2 of the worksheets and the cell numbers again, maybe I'm screwing it up somehow in my explanation.

    "Master" is the name of Worksheet 1, "Aiken CSD" is the name of Worksheet 2.

    I need to search columns C, D, E of Master for the information contained in columns A, B, C of Aiken CSD. If there is a match, I need to fill column G of Master (in whatever row the match was found in) with the info in column J of Aiken CSD. If there is no match found, it needs to remain blank. I have thousands of rows. I didn't know that mattered until reading some of your responses.

    Thanks!

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need a formula to make Excel search for info

    I need to search columns C, D, E of Master for the information contained in columns A, B, C of Aiken CSD. If there is a match, I need to fill column G of Master (in whatever row the match was found in) with the info in column J of Aiken CSD.
    I'm sorry, your quote above seems to be an exact replica of the original problem. In the sample workbook I gave you, change the names of the two sheets to MASTER and AIKEN CSD and that will update your formulas for them, then enter them into your real workbook exactly as you see them.

    If there are MORE sheets to deal with, this formula is currently only dealing with ws2 (Aiken CSD), If you need this formula to check other sheets, too, we'll need to see a better example, with perhaps 3-4 sheets.

  10. #10
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Need a formula to make Excel search for info

    Here is some reading material on the Index and Match functions:

    Single criteria:
    http://www.mrexcel.com/articles/exce...ndex-match.php
    http://www.ozgrid.com/Excel/left-lookup.htm

    Multiple criteria:
    http://support.microsoft.com/kb/214142
    Last edited by Whizbang; 10-13-2011 at 11:42 AM.

  11. #11
    Registered User
    Join Date
    10-12-2011
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    3

    Talking Re: Need a formula to make Excel search for info

    THANK YOU SO MUCH everyone, this worked! You have saved me so much work!


  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need a formula to make Excel search for info

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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