+ Reply to Thread
Results 1 to 5 of 5

vlookup based on two different search factors - but how??

  1. #1
    Registered User
    Join Date
    12-29-2011
    Location
    london
    MS-Off Ver
    Excel 2019 (MAC)
    Posts
    13

    vlookup based on two different search factors - but how??

    Hi all, I need to look up a value based on two search criteria:

    1) the month and year must match but not the exact date

    2) The reference number must match (The range being searched has other text too so search will based on 'contains text' sort of thing)

    I can't quite figure out what formula I use and how do I implement it..any help would be much appreciated.

    Hopefully the attachment explains a little better
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: vlookup based on two different search factors - but how??

    Try this, C3 copy down & across.

    =SUMPRODUCT(--(TEXT($A$14:$A$20,"mmm-yy")=TEXT(C$2,"mmm-yy")),--ISNUMBER(SEARCH(" "&$B3&" "," "&$B$14:$B$20&" ")),$D$14:$D$20)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    12-29-2011
    Location
    london
    MS-Off Ver
    Excel 2019 (MAC)
    Posts
    13

    Re: vlookup based on two different search factors - but how??

    Thanks Haseeb..Not sure I could ever do that...taking that to the next stage and me wanting to do this across two tabs...I have not been able to tweak the formula...I have attached a file again with the yellow bits highlighted and some commentary.

    Any idea what's wrong with the formula?

    Many thanks
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: vlookup based on two different search factors - but how??

    remove the " "& par, so use like,

    =SUMPRODUCT(--(TEXT('A&L'!$A$9:$A$391,"mmm-yy")=TEXT(O2,"mmm-yy")),--ISNUMBER(SEARCH(B3,'A&L'!B9:B391)),'A&L'!D9:D391)

    Also all ranges MUST be in SAME SIZE, in your file it was, A9:A391, B9:B20, D9:D20. all ranges must be either 9:20 or 9:391

  5. #5
    Registered User
    Join Date
    12-29-2011
    Location
    london
    MS-Off Ver
    Excel 2019 (MAC)
    Posts
    13

    Re: vlookup based on two different search factors - but how??

    BINGO! many thanks. Rep added

+ 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