+ Reply to Thread
Results 1 to 7 of 7

multiple lookup to return a result

  1. #1
    Registered User
    Join Date
    08-08-2022
    Location
    Geelong, Australia
    MS-Off Ver
    office professional 2019
    Posts
    2

    multiple lookup to return a result

    Hi,
    I'm new to the forum, but a big shout-out to the contributors sharing their vast knowledge. It is very helpful.

    I want to return a value "PH" for public holiday in the calendar I have created. Sheet 1 (AUG) has the State the employee belongs to and the Employees name and the subsequent days of the month. On Sheet 2 (HOLIDAYS) I have the list of public holidays by State, date and description.

    On Sheet 1(AUG) I want to have it automatically look at the Date AND State the employee is in and return "PH" if it matches within the holidays listed on Sheet 2 (HOLIDAYS).

    I have been looking at Vlookup and MATCH but getting myself totally confused.

    I have attached a sample spreadsheet

    thanks in advance for any assistance.

    cheers

    Kudu Rider
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: multiple lookup to return a result

    return "PH"
    Where do you want this to be returned?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: multiple lookup to return a result

    You could have an INDEX/MATCH formula in each cell of your calendar which could return PH to the cell if there is a match on the state and the date.

    However, you have data validation set up in those cells which implies that you also want to enter data manually into the cells (e.g. L ), and if you do this it will overwrite the formula that you have set up.

    I think you will need to reconsider how you are going to record the data - maybe by keeping a list in the Holidays sheet of every leave-booking and then to fill the calendar cells from that table, rather than do it manually.

    Hope this helps.

    Pete

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: multiple lookup to return a result

    You have multiple cells with "L"s in them (leave?). You can not have both a value like L and a formula in a cell...
    for PH, use:
    Please Login or Register  to view this content.
    Ben Van Johnson

  5. #5
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: multiple lookup to return a result

    Something like this in C4 will return "PH" where relevant, copied across and down.

    =IFERROR(INDEX(HOLIDAYS!$D$2:$D$6,MATCH(1,(DATE($AF$1,MONTH($AC$1&0),C$3)=HOLIDAYS!$B$2:$B$6)*(HOLIDAYS!$A$2:$A$6=$A4),0)),"")

    I'm not sure how you want this to sit alongside cells with "L" in though.

  6. #6
    Registered User
    Join Date
    08-08-2022
    Location
    Geelong, Australia
    MS-Off Ver
    office professional 2019
    Posts
    2

    Re: multiple lookup to return a result

    thanks for the quick responses. I'll give the above formulas a go and will let you know how I go.

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: multiple lookup to return a result

    Or try this

    =IF(COUNTIFS(HOLIDAYS!$A$2:$A$6,$A4,HOLIDAYS!$B$2:$B$6,C$2)>0,"PH","")

+ 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. [SOLVED] How to use lookup function to return multiple result
    By ncf0509 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-30-2020, 03:41 AM
  2. Lookup Multiple Conditions to return a result
    By marktilbrook in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2019, 06:34 PM
  3. [SOLVED] Lookup-and-return-multiple-values(Result:Ascending)
    By chief_abound in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-04-2016, 08:42 PM
  4. lookup multiple values in multiple columns to return a result
    By AYAHOO123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2013, 07:53 PM
  5. Lookup multiple conditions to return one result
    By cchrisj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2009, 03:52 PM
  6. Lookup multiple criteria in different tabs to return result
    By Nadir Soofi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-06-2008, 06:28 PM
  7. Return more then 1 result lookup
    By waz70 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2007, 04:22 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