+ Reply to Thread
Results 1 to 19 of 19

Vlookup from 2 columns

Hybrid View

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Vlookup from 2 columns

    Hi guys,

    This is my first post and I'm looking for some help with a vlookup function from 2 columns.

    I have sheet1 with the columns;

    sales date
    sales person
    sales number


    In sheet2 I want a function that looks up the "sales number" based on "sales date" and "sales person".

    Is it possible to have 2 vlookup criteria in one function?

    Many many thanks!

    Adrian

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    ..is it possible to have 2 vlookup criteria in one function?
    Yes it is. But i am not able to understand how your data looks like... Pls upload a small sample workbook.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Vlookup from 2 columns

    Hi Adriano85

    Assuming following:
    Dates in column A
    Sales person in Column B
    sales number Column C

    Try the following:
    =LOOKUP(2,1/((A:A=DATE(2013,4,22))*(B:B="Fred")),C:C)
    Change the date & sales person to suit
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  4. #4
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Hi guys,

    Please find attached an example of the sheet. I'm looking for a formula to find the number of bookings based on date and recruiter.

    Many thanks for your help!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Hi Kevin,

    What does the 2,1 do? Would like to understand the functions so it will be easier to use them in the future.

    Unfortunately it's not working yet.

    Adrian

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    Use same date format in H2 as column A. Then in J2 use this formula that gives 1 as result.

    =SUMPRODUCT((A2:A100=H2)*(B2:B100=I2)*(C2:C100))

  7. #7
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Very strange... I used exactly the same formula and the result is 0 while the booking in the table is 1.
    Do you have any idea while its not returning the correct number?

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    Quote Originally Posted by Fotis1991 View Post
    Use same date format in H2 as column A. Then in J2 use this formula that gives 1 as result.

    =SUMPRODUCT((A2:A100=H2)*(B2:B100=I2)*(C2:C100))

    ........................................

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Vlookup from 2 columns

    H2 does not contain an actual date value-it has text that looks like a date. try entering it again
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  10. #10
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Hey guys,

    I changed both formats into "date" but still 0 as result. What am I doing wrong?
    Attached Files Attached Files

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    See this .......................
    Attached Files Attached Files

  12. #12
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Vlookup from 2 columns

    replace the & in your formula with *

  13. #13
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Thanks for your great help. Much appreciated!

    I am wondering now, what if there are bookings for 2 or more countries? How can we let this function do a horizontal lookup in the column heading?

    Is this even possible?
    Attached Files Attached Files

  14. #14
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    ..............................
    Attached Files Attached Files

  15. #15
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Vlookup from 2 columns

    =SUMPRODUCT(($A$3:$A$101=H3)*($B$3:$B$101=I3)*INDEX($C$3:$D$101,,MATCH(J3,$C$2:$D$2,0)))
    for instance

  16. #16
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Do you have any idea why I get a reference error? (see attachment)
    Attached Files Attached Files

  17. #17
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    =sumproduct(($a$3:$a$101=h3)*($b$3:$b$101=i3)*($c$2:$d$2=j3)*($c$3:$d$101))

  18. #18
    Registered User
    Join Date
    04-15-2013
    Location
    the Netherlands
    MS-Off Ver
    excel 2010
    Posts
    12

    Re: Vlookup from 2 columns

    Awesome!

  19. #19
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vlookup from 2 columns

    ...........................

+ 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