+ Reply to Thread
Results 1 to 8 of 8

Lookup function

  1. #1
    Registered User
    Join Date
    01-27-2023
    Location
    UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    10

    Lookup function

    Hi All,

    I am currently using Lookup function: "=LOOKUP(B7,Sheet2!E9:E21,Sheet2!C9:C21)" to find specific times, for specific "B" column between two of my excel sheets.
    But there is one problem, if it cannot find the match it should be showing as error instead it's showing me the previous result which is very confusing.

    I have attached the sample (I hope at least).Trial.xlsx

    Is there any way to have it shown as error or is there nothing i can do?
    Last edited by czerwonywilk; 02-01-2023 at 10:31 PM.

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,411

    Re: Lookup function

    cell ranges B7:B21 must be set to time format, please refer to alternative solutions

    worksheet or tab name : Sheet1

    Cell C7 formula , Drag down and across

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-27-2023
    Location
    UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    10

    Re: Lookup function

    So there is no solution to keep it in the same format?

    As the zeros might not work with my requirements, and will give me more manual work which im trying to avoid.

  4. #4
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,411

    Re: Lookup function

    Hi czerwonywilk , Thank You for the feedback

    According to the attachment of POST#2, at this time you can use the formula of your 1st floor
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-27-2023
    Location
    UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    10

    Re: Lookup function

    Yes. But the problem is that number 10, 11, 12 are being picked normally, then if there is nothing after it, instead of showing error it shows 22:00.

    So if I have 12 at 22:00, and there is no 13 to be found - it will also show 22:00 and continue for every next number.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Lookup function

    with Power Query

    Time Monday Tuesday Wednesday Thursday Friday
    16:30:00
    6
    6
    7
    7
    6
    17:00:00
    7
    7
    8
    8
    17:30:00
    9
    18:00:00
    8
    8
    9
    7
    18:30:00
    9
    10
    10
    19:00:00
    9
    8
    19:30:00
    11
    20:00:00
    10
    10
    20:30:00
    11
    9
    21:00:00
    11
    11
    12
    21:30:00
    13
    12
    10
    22:00:00
    12
    12
    11
    22:30:00
    13
    14
    13
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,830

    Re: Lookup function

    Try this formula in C7 and copy across the whole table and down:

    =XLOOKUP($B7,INDEX(Sheet2!$E$9:$Q$21,,MATCH(C$6,Sheet2!$C$8:$O$8,0)),INDEX(Sheet2!$C$9:$O$21,,MATCH(C$6,Sheet2!$C$8:$O$8,0)),"Error",0)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-27-2023
    Location
    UK
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    10

    Re: Lookup function

    That one looks promising Gregb11, I'll try it on original file.

    Thanks all for help.

+ 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] A lookup function to return a persons function which will vary depending on dates
    By lloydalikes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-25-2020, 08:31 AM
  2. Function Help - LOOKUP (Site) & LOOKUP (Person within Values)
    By fwesley in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-21-2019, 01:05 PM
  3. [SOLVED] Lookup / Indirect function to lookup information from various tabs/worksheets
    By rajeshpansara in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-20-2019, 10:29 PM
  4. [SOLVED] Nest lookup Function to lookup name between date range and return value
    By bbeards in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2018, 01:37 PM
  5. lookup based on cellvalue... without the lookup function needed
    By NoSleepForMe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-16-2016, 04:54 AM
  6. Create a lookup formula with an If or Lookup function
    By afountas21 in forum Excel General
    Replies: 2
    Last Post: 09-05-2012, 06:53 PM
  7. [SOLVED] Pivot table doing a lookup without using the lookup function?
    By NGASGELI in forum Excel General
    Replies: 0
    Last Post: 08-02-2005, 01:05 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