+ Reply to Thread
Results 1 to 9 of 9

Lookup returning duplicate values when there' a blank. Can it search in sequence

  1. #1
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Lookup returning duplicate values when there' a blank. Can it search in sequence

    Hi all, in my sheet I want column E & F of Tab 2 to return a time value based on the reference in column B.

    The problem is that the reference in column B (Taken from a lookup on Tab1) may sometimes have a blank name next to it. If there is more than one blank name the returned result is always that of the first blank box it finds.

    Is there any way for the first blank box to give the details of the first blank's data on the tab 1 lookup and then subsequent blank cells to read the second, the third reads the third etc.

    Not the best explanation but if you need further info then please ask and I'll try to explain it a bit better without making a mammoth post.

    I know @JeteMc has helped me in the past with something similar but cant find a way to tag users.
    Attached Files Attached Files
    Last edited by m1cks; 09-04-2021 at 01:30 PM.

  2. #2
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. Just before posting, scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.

  3. #3
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    I'm trying to now but the file is too large. I'm just trying to remove information to reduce the file size without losing too much information to demonstrate the problem.

  4. #4
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    I am having trouble getting the file size to reduce so have made screenshots if what the problem is and what I need the sheet to do
    In Picture 1 it shows where the duplicated information is.
    In picture 2 it shows what information I want it to show. For example the return in column B R22 should be 1013 as in the second picture, not duplicating 1008.

    The formula in Column B is
    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by m1cks; 09-04-2021 at 01:12 PM.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    Can you not copy and paste a few rows to a new w/book as your picture is only 20-30-rows of data?

  6. #6
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    Thank you, that's worked. Original post updated with sample document.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    There are inconsistencies on "Front Sheet" date (B2) and the days in row 4: change the date but it simply puts it in H4. So subsequent data (row 5 onwards) is out out sync.


    Properly synchronised, a "lookup" under the date heading could extract the "name" i.e. 1008, 1013, 1204

    This >=???

    in C4 of "Front Page"

    =IFERROR(VLOOKUP(B$5:B$25,Formulas!G$1:H$21,2,FALSE),INDEX($H$5:$L$25,0,MATCH($B$2,$H$4:$L$4,0)))
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    Hi John. It appears the sheet lost some of it's functionality when I pasted it to a new document. C1 on tab 2 is a dropdown on my original version allowing you to select the day of the week you want the sheets to populate for. When you change the day it pulls the data from the corresponding column on the front sheet for the day you select.
    Column C of front sheet does not have any issues and pulls the correct data I am after.
    I realise now that looking at it the pay numbers are very similar to the duty numbers so have changed them to letters instead to avoid any confusion.
    I had also not changed the 1904 date system on the new document which is why the dates did not correspond to the formula table as they were 4 years out.
    I have made the changes and added the document again.

    In the example pictures above based on a Tuesday, B20 correctly reads 1008, B22 reads 1008 but should be 1013 which corresponds to I14 on the first tab and B23 should read 1204. It will then get the correct times from third tab.

    Here is a link to the first thread where I had issues getting the date to pull through when there was no populated name.
    HTML Code: 
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Lookup returning duplicate values when there' a blank. Can it search in sequence

    The only solution I can offer is that in post #7 where the is extracted from h5:L25.

    I don't understand the underlying business logic with so many "key" references (Rotation, Folder no, Name, Pay no).

    If the roster is the "Front Sheet" column for a given date e.g. column I for 14 Sept, then why is that not the source for the "Sign on sheetS?

    And why have blank rows anyway: there must be logic which allows them to be removed?

    based on my comments above:

    in C6 of "sign on Sheets"

    =IFERROR(INDEX('Front Sheet'!$H$5:$N$25,AGGREGATE(15,6,(ROW($A$5:$A$25)-ROW($A$5)+1)/(INDEX('Front Sheet'!$H$5:$N$25,0,MATCH($C$1,'Front Sheet'!$H$3:$N$3,0))<>""),ROWS($1:1)),MATCH($C$1,'Front Sheet'!$H$3:$N$3,0)),"")

    copy down
    Last edited by JohnTopley; 09-05-2021 at 07:18 AM.

+ 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] Lookup returning duplicate values when referencing a blank
    By m1cks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-28-2021, 10:15 PM
  2. VBA returning 3 duplicate search results
    By Rez4ul in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2016, 12:23 AM
  3. Returning values for duplicate references
    By AlexnL12 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-21-2015, 01:05 PM
  4. [SOLVED] Returning a blank cell if the lookup value is empty
    By mgmerv in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 06:59 AM
  5. Adding Sequence # to a duplicate values
    By aravindhan_31 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2010, 11:55 AM
  6. Returning a blank cell rather then #N/A (Lookup)
    By Monk in forum Excel General
    Replies: 2
    Last Post: 01-24-2006, 11:20 AM
  7. Replies: 3
    Last Post: 10-10-2005, 01:05 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