+ Reply to Thread
Results 1 to 7 of 7

Search Cells for given text and return closest date in row below

  1. #1
    Registered User
    Join Date
    02-13-2023
    Location
    NSW, Australia
    MS-Off Ver
    2108
    Posts
    12

    Post Search Cells for given text and return closest date in row below

    Hi,

    For a set product I have a criteria section in cells D2 to ABC2, these are COMPLETE, UNDER TEST, NOT STARTED/SAMPLED. In Cells D5 to ABC5 I have estimated completion dates. I want to determine the next date that a sample categorised as "UNDER TEST" will be completed.

    I have tried the below formulas which don't return the correct answer.

    =MIN(IF(D2:ABC2="*UNDER TEST*", ABS(D5:ABC5-TODAY()), ""))

    =INDEX(D5:Z5,MATCH(MIN(IF(D2:ABC2="UNDER TEST",IF(ISNUMBER(DATEVALUE(D5:ABC5)),ABS(DATEVALUE(D5:ABC5)-TODAY())))),IF(D2:ABC2="UNDER TEST",IF(ISNUMBER(DATEVALUE(D5:ABC5)),ABS(DATEVALUE(D5:ABC5)-TODAY()))),0))

    =XLOOKUP("UNDER TEST",D2:ABC2,IF(ISNUMBER(DATEVALUE(D5:ABC5)), ABS(DATEVALUE(D5:ABC5)-TODAY()), ""),"INCORRECT",1,2)

    Any help would be greatly appreciated

  2. #2
    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,053

    Re: Search Cells for given text and return closest date in row below

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    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

  3. #3
    Registered User
    Join Date
    02-13-2023
    Location
    NSW, Australia
    MS-Off Ver
    2108
    Posts
    12

    Re: Search Cells for given text and return closest date in row below

    Example of data, next available will be on a separate worksheet
    Attached Files Attached Files

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

    Re: Search Cells for given text and return closest date in row below

    This is not clear. Where on your sample is your mocked up results? In which cell are you wanting a formula - A9?
    In words, not formula, explain how to get the answer you're looking for.

  5. #5
    Registered User
    Join Date
    02-13-2023
    Location
    NSW, Australia
    MS-Off Ver
    2108
    Posts
    12

    Re: Search Cells for given text and return closest date in row below

    In cell A9 I want a formula to display the ETA date the next sample currently categorised as "UNDER TEST" will become available. So the formula will search through row 2 and only look for UNDER TEST columns then compare all their ETAs in row 4 and return the ETA which is the closest to today's date. In the example attached I want the formula to return "26/02/23".

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

    Re: Search Cells for given text and return closest date in row below

    Try this in A9:

    =LET(
    UnderTestDates,FILTER(D4:H4,D2:H2="Under Test"),
    DayDiffs,ABS(TODAY()-UnderTestDates),
    MinDayDiff,DayDiffs=MIN(DayDiffs),
    INDEX(UnderTestDates,,MATCH(TRUE,MinDayDiff,0)))

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-13-2023
    Location
    NSW, Australia
    MS-Off Ver
    2108
    Posts
    12

    Re: Search Cells for given text and return closest date in row below

    Thank you that now works!
    Last edited by rach1995; 02-23-2023 at 12:36 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. Macro to find the closest date and return the cell.address (inferior date)
    By QcHuldar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2020, 03:55 PM
  2. Search Cells for range of text / Return different text to another cell
    By earl2grey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2019, 03:52 PM
  3. [SOLVED] Search Range of Cells for Text string and return latest Date
    By ajlogan in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-15-2018, 08:30 AM
  4. IFERROR - SEARCH - Look for date/text values and return a specified text name
    By chrisbay2324 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-01-2018, 03:26 PM
  5. [SOLVED] Index/match return value row1 and value column A closest > search value
    By 323428 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-25-2018, 03:15 PM
  6. Search a cell for text, and return all surrounding text between two cells
    By TRAPSON in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-13-2017, 02:19 PM
  7. Workbook Search and Return Closest Adjacent Numerical Value
    By maxymab in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 05:29 PM

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