+ Reply to Thread
Results 1 to 4 of 4

Combining INDIRECT with OR for use in conditional formatting

  1. #1
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Combining INDIRECT with OR for use in conditional formatting

    Hi all,

    this might seem like a simple question to some of the more experienced users but here 'tis...

    I'm using conditional formatting with a formula to highlight certain rows where a column contains a specific piece of text, for example:
    Please Login or Register  to view this content.
    What I'd like to do is check for several different pieces of text and so I thought that using an OR statement might help - thing is, I don't know whether to put the OR before the INDIRECT, or vice versa - I've tried both ways but I guess I must be leaving out a comma or parenthesis (or something) because it's not working the way I would like.

    This what I've been trying...
    Please Login or Register  to view this content.
    Any ideas on what I'm doing wrong here?

    Cheers,

    AJ
    Last edited by ScotyB; 05-06-2012 at 01:18 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combining INDIRECT with OR for use in conditional formatting

    Hi,
    Perhaps

    =IF(OR(INDIRECT("C"&ROW())="Text 1",INDIRECT("C"&ROW())="Text 2"),"then this","if not that")
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Combining INDIRECT with OR for use in conditional formatting

    tRY:

    =OR(INDEX($C:$C,ROW())="Text 1",INDEX($C:$C,ROW())="Text 2")

    INDIRECT is volatile, INDEX is not volatile.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: Combining INDIRECT with OR for use in conditional formatting

    Guys,

    thanks to both of you for taking a look - I've gone with NBVC's solution as that does exactly what I was hoping for.

    Again, thanks for your time and expertise.

    Cheers,

    AJ

+ 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