+ Reply to Thread
Results 1 to 6 of 6

Refining a search with the SEARCH Function?

  1. #1
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Refining a search with the SEARCH Function?

    Hello

    Some of my cells contain, amongst other text, times in brackets in the following format: (tt:tt) eg (23:54).

    I'd like to search for these using a formula and so for example use

    =SEARCH("(??:??)",A1)

    and to trigger conditional formatting

    =ISNUMBER(SEARCH("(??:??)",A1))

    These all work but of course also detect alphabetic characters like (ab:cd)

    I'd like to perform a search that only detects numbers or even better a valid time between the brackets, is this possible please?

    Thanks
    Robin

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Refining a search with the SEARCH Function?

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Refining a search with the SEARCH Function?

    BTW are you still using XL2010? If not please amend your profile, as answers are tailored to the OP's XL version. Thanks

  4. #4
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Re: Refining a search with the SEARCH Function?

    Hello

    Yes I am still using XL2010.

    This was a simple question about functions, and so creating a sample worksheet to demonstrate the problem seems to me like overkill.

    In any case I have now solved the problem:

    1. Assume (xx:yy) is a time.
    2. Extract xx and yy and perform a TIME function: =TIME(xx,yy,0)
    3. Test for an error

    It's now all working as required, my conditional formatting is now highlighting cells that contain a valid time.

    Cheers
    Robin

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,770

    Re: Refining a search with the SEARCH Function?

    Thanks for letting us know. Please mark this thread as solved.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,770

    Re: Refining a search with the SEARCH Function?

    1. Assume (xx:yy) is a time.
    2. Extract xx and yy and perform a TIME function: =TIME(xx,yy,0)
    If you were able to extract the left and right portions of the cell, then it is NOT actually a time, but text that looks like a time. I think this is what was being hinted at when your workbook was requested. Real time values, like dates, are just a number, so 12:00 will change to 0.5 if you change the cell formatting to general. If the cell contents do NOT change, then this confirms that you have text and not a real time value.

    I hope this makes sense.

+ 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. Search Function - how to search for multiple items
    By niktodorov1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-01-2018, 10:22 PM
  2. Refining Famous Search Engine
    By edu.franca13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2014, 04:21 PM
  3. [SOLVED] Set VBA search function to only search one row and also not show duplicates?
    By TomToms in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2014, 04:00 PM
  4. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  5. IF(count(search) Function not working when search from text from a cell
    By joshnathan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 05:13 AM
  6. [SOLVED] Search function to search if worksheet contains specified text
    By mougiasm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2013, 02:50 PM
  7. Replies: 1
    Last Post: 10-18-2012, 05:52 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