+ Reply to Thread
Results 1 to 12 of 12

Lookup formula to match against two columns

Hybrid View

  1. #1
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Lookup formula to match against two columns

    I have 3 columns, A,B and C.
    B is a Master List of locations.
    C is a Project list and is a dependent list to B.

    I need a formula in column A to lookup and match B to C and return an account number from AccountNums (Named Range).

    Some of the project names in column C are the same, and my current formula returns the wrong account number because it only looks at column C and matches the first project it comes to with the selected name. There may be 10 projects with the name ENHANCEMENT at 10 different locations.

    My current formula:

    =IF(C12="","",VLOOKUP(C12, AccountNums,2,FALSE))

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

    Re: Lookup formula to match against two columns

    Please post an example. Seems like that would greatly speed up an answer
    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.

  3. #3
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Lookup formula to match against two columns

    Try this formula....
    and change it your requirement
    drag it down to cover B3, B4 and so on...

    Formula: copy to clipboard
    =index(AccountNums,match(B2,$C$2:$C$100),1)


    Waiting for *

  4. #4
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Lookup formula to match against two columns

    Here is an example.
    Thank you.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: Lookup formula to match against two columns

    HI,

    Find the updated file.

    Punnam
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Lookup formula to match against two columns

    Thanks Punnam. I appreciate you assistance.
    That works great!

  7. #7
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: Lookup formula to match against two columns

    Hi WFP111,

    Welcome .

    Punnam

  8. #8
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: Lookup formula to match against two columns

    HI,

    if u r question answered mark the thread solved using thread tools TAB.

    Punnam

  9. #9
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Lookup formula to match against two columns

    Punnam,
    If you are still available or if someone else may be able to address a new issue.
    This Formula works great in a simple table where data is manually typed in. However, I receive an ERROR when I place the formula in my master workbook.

    "=IFERROR(INDEX(Lists!$C$2:$C$13,MATCH(PROJECTS!B10&PROJECTS!C10,Lists!$A$2:$A$13&Lists!$B$2:$B$13,0))," ")"

    My "Lists!" tab actually reads from another workbook. Therefore, I believe it may be the cause for the ERROR.

  10. #10
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: Lookup formula to match against two columns

    Hi,

    Can u post a masterwork book with out confidential data ?

    punnam

  11. #11
    Registered User
    Join Date
    06-05-2013
    Location
    Syracuse, NY
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Lookup formula to match against two columns

    Thanks Punnam.
    I attached the ProjectsWorkbook and the ProjectsList that it reads from.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: Lookup formula to match against two columns

    Hi,

    Small change in the formula ,
    1) Lists!B10&Lists!C10 should be replaced with C4&D4
    2) FOr array it is necessary to use Ctr+Shift+Enter
    =IFERROR(INDEX(Lists!$C$2:$C$22,MATCH(C4&D4,Lists!$A$2:$A$22&Lists!$B$2:$B$22,0)),"error")
    Punnam

+ 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. [SOLVED] Is a there a lookup formula I can use to match data from multiple columns of data?
    By missydanni in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2013, 08:27 AM
  2. Replies: 0
    Last Post: 07-02-2013, 01:37 PM
  3. Formula to lookup data in multiple columns, find a match and provide output.
    By dwitherow in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-31-2012, 12:24 PM
  4. Replies: 7
    Last Post: 06-19-2011, 12:51 PM
  5. Replies: 5
    Last Post: 02-24-2011, 11:26 AM

Tags for this Thread

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