+ Reply to Thread
Results 1 to 6 of 6

Use cell value as operation in conditional formatting

  1. #1
    Registered User
    Join Date
    12-14-2011
    Location
    Rochester, MN, USA
    MS-Off Ver
    Office 2010 and 365
    Posts
    54

    Question Use cell value as operation in conditional formatting

    Is there a way to use the contents of a cell to evaluate conditional formatting?

    For example; in cell [A1] I have the text ">5". In cell's [A2:A11] I have the numbers 1-10. How do I create a conditional formatting formula to use what's in cell [A1] to evaluate the condition of the other cells being >5?

    And yes, I'm aware I could use "Format only cells that contain" and use "Cell Value, greater than, 5" as the parameters. However, the literal ">5" needs to be visible on the sheet, and the conditional formatting needs to update if the user changes ">5" to ">x"

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

    Re: Use cell value as operation in conditional formatting

    As long as it will always be > you could use
    =A2 >--MID(A$1,2,100)

    But I don't think you can use the symbol from A1

  3. #3
    Registered User
    Join Date
    12-14-2011
    Location
    Rochester, MN, USA
    MS-Off Ver
    Office 2010 and 365
    Posts
    54

    Re: Use cell value as operation in conditional formatting

    Quote Originally Posted by Fluff13 View Post
    As long as it will always be > you could use
    =A2 >--MID(A$1,2,100)

    But I don't think you can use the symbol from A1
    Thank you! That gave me enough to use the following:
    =G7>=--RIGHT($G$4,LEN($G$4)-FIND(" ",$G$4))

    Of course it'll only work so long as there is a SPACE between the operator and the number. I could not find a way to compensate for a missing space.

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

    Re: Use cell value as operation in conditional formatting

    With the formula I supplied it doesn't matter if there is a space or not.
    So if G4 contains >3, > 3, >11234 it will still work. (as long as the number is not more than 98 digits in length)

  5. #5
    Registered User
    Join Date
    12-14-2011
    Location
    Rochester, MN, USA
    MS-Off Ver
    Office 2010 and 365
    Posts
    54

    Re: Use cell value as operation in conditional formatting

    Quote Originally Posted by Fluff13 View Post
    With the formula I supplied it doesn't matter if there is a space or not.
    So if G4 contains >3, > 3, >11234 it will still work. (as long as the number is not more than 98 digits in length)
    Oh yeah... I was not thinking about the symbol - which will never be more than ONE character.

    THANK YOU!

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

    Re: Use cell value as operation in conditional formatting

    You're welcome & thanks for the feedback

+ 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. VBA to scan visible results after applying a filter and then perform conditional operation
    By milton friedman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2013, 08:49 AM
  2. Replies: 0
    Last Post: 10-11-2012, 11:30 AM
  3. Replies: 0
    Last Post: 07-03-2012, 09:36 AM
  4. conditional operation !!!
    By pamnani in forum Excel General
    Replies: 2
    Last Post: 05-23-2008, 04:38 AM
  5. [SOLVED] Advanced formatting operation on a cell
    By Konrad Viltersten in forum Excel General
    Replies: 5
    Last Post: 07-21-2006, 04:55 AM
  6. Conditional Formatting type of operation
    By titushanke in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-13-2005, 03:25 AM
  7. Conditional operation
    By Shetty in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-17-2005, 10:06 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