Consulting

Results 1 to 12 of 12

Thread: vlookup across multiple column range

  1. #1

    vlookup across multiple column range

    Hi All - I've the "Item number" as lookup value in Col A. The values to be looked up (table array) is across multiple columns (6 columns). Ask: If the given item number exist in any of the 6 columns, then return the value of column 7. Tried multiple formulas including array but didn't get it done.. Can some one help? Appreciate it. PFA the excel file.
    Attached Files Attached Files

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,783
    Location
    Which version of Excel do you have?
    Be as you wish to seem

  3. #3
    Quote Originally Posted by Aflatoon View Post
    Which version of Excel do you have?
    MS office Professional Plus 2021

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,935
    try something along the lines of:
    =INDEX('Raw data'!$F$1:$F$6,MIN(IF((A7='Raw data'!$A$2:$E$6),ROW('Raw data'!$A$2:$E$6))))
    Note red numbers in the formula:
    =INDEX('Raw data'!$F$1:$F$6,MIN(IF((A7='Raw data'!$A$2:$E$6),ROW('Raw data'!$A$2:$E$6))))
    (I've been lazy.)
    Last edited by Aussiebear; 12-06-2024 at 05:28 PM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    It works. This is awesome. Thanks for the quick help. Appreciate a ton.

  6. #6
    Administrator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,260
    Location
    I believe Professional Plus 2021 has the TOCOL function, if so, you could also use:
    =TOCOL(IF('Raw data'!$A$2:$E$6=A5,'Raw data'!$F$2:$F$6,NA),2)
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2408, Build 17928.20080

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,935
    Quote Originally Posted by georgiboy View Post
    I believe Professional Plus 2021 has the TOCOL function
    Much better!
    Mine does silly things when the part number isn't found. I was working on improving it when I saw georgiboy's solution.
    Could tsr_83 confirm that TOCOL is available?
    My Excel compatibility checker say's it's OK but this article implies it's not!: https://answers.microsoft.com/en-us/...1-ef1fc76b233c
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  8. #8
    TOCOL is available in my excel but need to know which cell shall i put the formula
    =TOCOL(IF('Raw data'!$A$2:$E$6=A5,'Raw data'!$F$2:$F$6,NA),2)

  9. #9
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,281
    Location
    Where would you like the result to be shown?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  10. #10
    In output sheet, A34:A58 has the input value and want the output value in B34:58

    vlookup across multiple columns_pic.jpg

  11. #11
    Administrator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,260
    Location
    So it would go in B34 and you would drag it down, see attached your original attachment with formula added.
    Attached Files Attached Files
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2408, Build 17928.20080

  12. #12
    Thank you

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •