+ Reply to Thread
Results 1 to 7 of 7

Search with or

  1. #1
    Forum Contributor
    Join Date
    08-15-2014
    Location
    Michigan, USA
    MS-Off Ver
    MS Office 2021
    Posts
    101

    Search with or

    Using the following formula in conditional formatting.
    =IFERROR(MOD(VALUE(LEFT(A1, SEARCH("/",A1)-1))-1,9)+1,MOD(A1-1,9)+1)=2
    Does what I want.
    Want to expand the search to look for "/" or " "
    I tried adding in OR but it not working.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Search with or

    Your formula is effectively =IFERROR(a+1,b+1)=2. Any reason it couldn't be =IFERROR(a,b)=1 ? Other simplications are possible.

    As to the main issue, use an array to search for both, then use the minimum of the positions found. With some trickery, you don't need IFERROR.

    =MOD(LEFT(A1,MIN(FIND({"/";" "},A1&" /"))-1),9)=1

    Note that MOD automatically converts its arguments to numeric values, so VALUE isn't needed (unless you're using Transition Formula Evaluation, which you shouldn't be a decade and a half after IBM pulled the plug on Lotus 1-2-3).

  3. #3
    Forum Contributor
    Join Date
    08-15-2014
    Location
    Michigan, USA
    MS-Off Ver
    MS Office 2021
    Posts
    101

    Re: Search with or

    When I enter in the formula I get "You may not use unions, intersections, or array constants for conditional formatting criteria."

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Search with or

    Maybe try:
    Please Login or Register  to view this content.
    Quang PT

  5. #5
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Search with or

    Sorry. I didn't pay enough attention to the conditional formatting part. One way would be to defined the names chars referring to =" /" and chara referring to ={" ";"/"}, then use the formula =MOD(LEFT(A1,MIN(FIND(chara,A1&chars))-1),9)=1 .

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Search with or

    Another option
    =MOD(LEFT(A2,MIN(SEARCH(" ",A2&" "),SEARCH("/",A2&"/"))-1)-1,9)

  7. #7
    Forum Contributor
    Join Date
    08-15-2014
    Location
    Michigan, USA
    MS-Off Ver
    MS Office 2021
    Posts
    101

    Re: Search with or

    Thanks bebo021999 the =MOD(LEFT(A1,IFERROR(IFERROR(SEARCH("/",A1),SEARCH(" ",A1)),LEN(A1)+1)-1)-1,9)+1 works perfectly.

+ 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] Search multiple worksheets for search term and paste results in a summary sheet
    By Andy15 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-03-2017, 01:49 PM
  2. [SOLVED] Code to search Excel and return results even if part of search text is present
    By Taoyuan00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2016, 09:20 AM
  3. Replies: 4
    Last Post: 12-02-2014, 05:17 PM
  4. Replies: 4
    Last Post: 11-08-2014, 04:57 AM
  5. Replies: 4
    Last Post: 05-20-2014, 10:03 AM
  6. 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
  7. Truncate text strings using LEFT and FIND/SEARCH for multiple search terms
    By ngdoherty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2013, 07:51 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