+ Reply to Thread
Results 1 to 10 of 10

Return a value based on two criteria

  1. #1
    Registered User
    Join Date
    11-13-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Return a value based on two criteria

    Hey everyone, if anyone could help me with this that would be great.

    I have a sheet that contains around 400 employees, including their managers that they report to. Every week it is updated with changes to different teams, new hires, terminations, etc. and I just paste the new data with the date of the change on the same sheet.
    I also have another sheet where I keep track of customer credit requests that each employee submits and the date that they submit them.
    My question is, I need to have the name of the employee's manager populate next to their name, and it has to pull from the sheet of all total employees. It also has to pull from who their manager was when they actually submitted the credit request. Is there a way to use a vlookup that is dependent on two different values (the name of the employee and the date of his request)? I've tried Index and Match, but can't get them to work.
    Thanks

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Return a value based on two criteria

    Without seeing the way your sheet is laid out, it is hard to tell if VLOOKUP will work. However, INDEX-MATCH will work... Can you post a suitably anonymised Excel sheet?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    11-13-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Return a value based on two criteria

    Test.xlsx

    So the three columns on the left show the date the request was submitted and who submitted it. The three columns on the right shows which employee belongs to which manager. Let's say the team roster changed on 11/3/14. I need to write a formula for column C that will autopopulate who the manager was of the employee dependent on the date that the credit request was submitted. Let me know if that doesn't make sense though.

    Thanks
    Last edited by statlerhale0; 11-13-2014 at 02:20 PM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Return a value based on two criteria

    It worked...

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Return a value based on two criteria

    Hi. I think that this is what you need. It is an array formula and needs to be set with CTRL + SHIFT + ENTER, not just enter (don't type the curly brackets: Excel will add them - if they're there, you will know that the formula will work OK).
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Return a value based on two criteria

    Sorry, I forgot to add a term to get rid of the irritating #N/A errors that it puts there when it doesn't find a match. Use this, instead
    Attached Files Attached Files

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return a value based on two criteria

    I interpreted your requirement to mean that the dates in column A combined with the name in column B are submitted in columns E and F. If the date matches OK return the Manager Name. If the date from column A is between the dates in column F don't change Manager name unless the date in column A is equal to or later than the date in column F.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Registered User
    Join Date
    11-13-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Return a value based on two criteria

    Thanks for your help, both of you. That is perfect!
    +1 Rep

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return a value based on two criteria

    Thank you for the feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Return a value based on two criteria

    Likewise, thanks for the feedback.

+ 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. Return a value based on 2 criteria being met
    By BigPhil84 in forum Excel General
    Replies: 2
    Last Post: 05-19-2014, 07:27 AM
  2. [SOLVED] return a value based upon one of three criteria
    By charles1394 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-14-2012, 01:02 AM
  3. Return name based on 2 criteria
    By QUESTIONS123 in forum Excel General
    Replies: 3
    Last Post: 04-10-2012, 11:03 PM
  4. Return value based off 2 criteria.
    By iamdavid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-11-2010, 05:37 PM
  5. return MAX based on criteria
    By anoushka in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-13-2008, 10:16 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