+ Reply to Thread
Results 1 to 9 of 9

In match search how to display "NO DATA" if no instance of criteria

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    In match search how to display "NO DATA" if no instance of criteria

    Hi I have adapted a formula to search a range for the last instance of an entry with the letter "A" prefix, it then displays it on a sheet relative to its item number. Took me a while because I hadn't noticed the item number I used first had no instance of an "A" and therefore was blank. How can I change formula to display "NO_DATA" when this occurs.

    Any help appreciated

    Rgds Nigel

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",LOOKUP(9.99E+307,MATCH(TRIM(LEFT(INDEX(total,MATCH($A$5,total1,0),0),2)),{"A","B","ac"},0),INDEX(total,MATCH($A$5,total1,0),0))))

    * This formula was adapted from a version that initailly had to search for "A" or "VC" so I changed 3rd criteria to "ac" so it didn't record the "VC" entries
    Last edited by nigelog; 05-22-2013 at 11:05 AM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: In match search how to display "NO DATA" if no instance of criteria

    Without seeing some sample data it's hard to tell what you want the formula to do.

    Maybe all you want to do is replace the formula blank like this:

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"NO_DATA"....

    On a side note...

    I would replace both:

    REPT("Z",255)
    9.99E+307

    With:

    "zzzzz"
    1E100

    =LOOKUP("zzzzz",CHOOSE({1,2},"",LOOKUP(1E100,......
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: In match search how to display "NO DATA" if no instance of criteria

    Thanks for prompt reply - I am attaching a copy of the file

    If you first check sheet "schedule", the data is recorded in range I:N and a number of entries have a Checked checkbox under priority service. Under ADD INs above a macro will pick the data required and forward it to sheet PRIORITY. In the column G you will find the last instance of an A service for that machine. (USE THE CLEAR CONTENTS ADD IN to remove the data before the next PRINT PRIORITY)

    not elegant but I'm never left finish anything

    any further details required please ask

    Rgds Nigel
    Attached Files Attached Files

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: In match search how to display "NO DATA" if no instance of criteria

    Sorry, but I have a personal rule where I won't open files with macros or that are bigger than 50kbs.

    I just noticed that you're using Excel 2007.

    You can replace all of this:

    LOOKUP(REPT("Z",255),CHOOSE({1,2},"",

    With the IFERROR function.

    =IFERROR(LOOKUP(1E100,......),"No_Data")
    Last edited by Tony Valko; 05-22-2013 at 10:55 AM.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: In match search how to display "NO DATA" if no instance of criteria

    ok Tony - give me 5min I'll just supply front page - all macros removed

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,694

    Re: In match search how to display "NO DATA" if no instance of criteria

    I don't think your current formula works because LEFT function is pulling the first two characters, that won't ever match with "A" unless the entry is "A" only. Try this version

    =IFERROR(LOOKUP(2,1/(LEFT(INDEX(total,MATCH($A$5,total1,0),0))="A"),INDEX(total,MATCH($A$5,total1,0),0)),"NoData")
    Audere est facere

  7. #7
    Registered User
    Join Date
    04-22-2013
    Location
    The Netherlands
    MS-Off Ver
    Excel 2003/2007 & 2010
    Posts
    90

    Re: In match search how to display "NO DATA" if no instance of criteria

    nigelog, in which cell can we find the formula you noted down above?

  8. #8
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: In match search how to display "NO DATA" if no instance of criteria

    stripped file - description would still apply

    in the book4 workbook look in I3 and I4 for formula - in other file look in Last service parked in PRIORITY sheet

    Ta Nigel
    Attached Files Attached Files
    Last edited by nigelog; 05-22-2013 at 11:04 AM.

  9. #9
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: In match search how to display "NO DATA" if no instance of criteria

    On the ball daddylonglegs

    works a treat - much obliged for the help

    marked as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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