+ Reply to Thread
Results 1 to 4 of 4

Need to lookup across multiple columns and return a value in a column

  1. #1
    Registered User
    Join Date
    01-09-2023
    Location
    Canada
    MS-Off Ver
    Office 2016 Pro Plus
    Posts
    1

    Question Need to lookup across multiple columns and return a value in a column

    Hi Everyone,

    Long time lurker and reader here. I'm working in healthcare and needed help with a lookup function. I tried searching on google and youtube for tutorials but couldn't find quite exactly what I need.

    help pic.png

    I'm trying to create a formula for cells E9 to F11. Essentially I want to lookup the codes in D9 to D11, which may be in any one of the Code1 to Code4 columns (4 columns), I then I want to return the TicketID and Date.

    I don't know how to search in multiple columns like this. Can someone please help point me in the right direction?

    thank you kindly,
    Attached Files Attached Files
    Last edited by bdphsa; 01-09-2023 at 06:08 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Need to lookup across multiple columns and return a value in a column

    A Power Query Solution
    1. Load your Data Table to Power query/Get and Transform
    2. Unpivot your data as shown below

    Please Login or Register  to view this content.
    3. Close and Load to a Connection Only
    4. Load your lookup data to PQ
    5. Join the two queries on the common lookup field.

    Please Login or Register  to view this content.
    Close and Load to your workbook.

    See all the steps in the attached file.



    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,004

    Re: Need to lookup across multiple columns and return a value in a column

    try this
    E9
    Please Login or Register  to view this content.
    F9
    Please Login or Register  to view this content.
    copied down.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Need to lookup across multiple columns and return a value in a column

    In E2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In F2
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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. Replies: 1
    Last Post: 02-12-2021, 07:21 PM
  2. Replies: 1
    Last Post: 05-12-2020, 08:42 AM
  3. [SOLVED] Lookup multiple criteria in multiple columns in multiple rows; return true if exists
    By ufdlim in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-07-2019, 02:03 PM
  4. Replies: 8
    Last Post: 09-21-2017, 03:43 PM
  5. Replies: 5
    Last Post: 07-28-2016, 08:18 AM
  6. Replies: 0
    Last Post: 10-16-2013, 12:42 PM
  7. Replies: 1
    Last Post: 10-17-2010, 03: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