+ Reply to Thread
Results 1 to 8 of 8

Multiple column lookup

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Teesside, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Multiple column lookup

    Hi
    I am trying to create an anonymised list of clients and activities in a community group that monitors funding sources and client attendance over time.

    I have two sheets:
    ClientData contains full un-anonymised data from clients – name, contact details, membership no , AttendanceNumber and activity .
    Lookup has a list of activities with a corresponding 4 digit code for each activity’s funding source, code for Attendance1, Attendance2+ and Other (used for activities that aren't funded externally or that aren't used for reporting back to funders)

    I wish to create a third sheet that shows just the client membership number and the code that corresponds to their activity. I would normally just use index/match or a simple lookup (I have done this for the funding source) but am getting stuck with the attendance number aspect. I need the formula to look up a client ID and if it is their 1st attendance, look up the code in the Lookup/Attendance1 column. If it is not a first attendance (ie ClientData/Attendance is >1), look in the Attendance2+ column and then, if either of those columns are empty, return the corresponding value from the "other" column and return this value

    I hope I have explained this properly! Thanks in advance for any help
    J
    Attached Files Attached Files
    Last edited by badgerboy13; 01-04-2019 at 09:43 AM. Reason: attachment added

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Multiple column lookup

    Hi J,

    Might be easier to provide a solution if we could see it in context. Attach a sample workbook showing your data layout and expected results.

    To attach a sample workbook click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    BSB

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    Teesside, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple column lookup

    Hi BSB, thanks, I had tried when I first posted but got a message that I couldn't add attachments until I'd posted some more. Now attached.
    J

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

    Re: Multiple column lookup

    Pl upload a sample file giveing some examples in the file with explanation hoe you are getting result.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  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 2403
    Posts
    44,055

    Re: Multiple column lookup

    To return the ID numbers, sorted in umerical order, an array formula:

    =IFERROR(INDEX(ClientData!$C$2:$C$19,MATCH(0,COUNTIF(ClientData!$C$2:$C$19,"<"&ClientData!$C$2:$C$19)-SUM(COUNTIF(ClientData!$C$2:$C$19,"="&A$1:A1)),0)),"")

    To return the Activity Code, a bit of a monster:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    What is the Referral Code? It might be possible to simplify this considerably, depending on yur answer to that Q....
    Attached Files Attached Files
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  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 2403
    Posts
    44,055

    Re: Multiple column lookup

    I forgot to add:

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

  7. #7
    Registered User
    Join Date
    11-29-2012
    Location
    Teesside, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple column lookup

    Thanks Glenn, that works exactly how I want it too.
    Thank you so much for your help
    J

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

    Re: Multiple column lookup

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Multiple column lookup
    By TrishB in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-20-2018, 08:17 AM
  2. [SOLVED] Multiple Lookup on raw and column
    By Shihab in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-12-2016, 12:08 PM
  3. Replies: 7
    Last Post: 07-26-2015, 04:02 PM
  4. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  5. Lookup Data in One Column, Find Multiple Entries in Next, Copy to Multiple Columns
    By nzxt1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2010, 01:17 AM
  6. Lookup multiple values in same column with same column heading
    By kcasey1318 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2010, 05:13 PM
  7. Lookup adjacent column to multiple lookup columns.
    By JAMES4228 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-13-2009, 03:19 PM

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