+ Reply to Thread
Results 1 to 4 of 4

Conditionally formatting a cell only if another cell contains a specific text value.

  1. #1
    Registered User
    Join Date
    05-01-2017
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2016
    Posts
    6

    Conditionally formatting a cell only if another cell contains a specific text value.

    I have a linked table in Excel that brings in trade details with many columns. Each row is a different trade and the columns are the details of the trade: Buy or Sell, price, trader, quantity, delivery date, location, etc. When I refresh the table, new trades flood into this table if they fail to meet certain criteria that I've written in VBA. When a trade fails said criteria, there is a short explanatory comment that tells me why the trade failed the criteria and which detail it pertains to. This comment updates to the column titled COMMENT as ";AAAAA". For example, If the price was $105 instead of $1.05, the comment, ";PRC", will update to this column.

    Since there are many columns to this table and many criteria that a trade could potentially fail, I want to be able to see what the comment says, scroll to the right and see the value that caused the trade to fail the criteria right away instead of searching through all of the columns for the one labeled, "PRICE" and then looking down to see what the value is for that specific trade.

    So, if trade #1 contains ";PRC" in the "COMMENT" field, I want only the cell that contains trade #1's Price to highlight a certain color.

    The catch to this is, however, one trade can have multiple comments in the "COMMENT" field. It can have ";PRC;QUANTITY" if the trade failed both price criteria and quantity criteria. I want it then to be able to highlight the PRICE cell as well as the QUANTITY cell.

    I know I'll have to use a conditional formatting formula, and I know I will have to make a different formula for each potential comment, I just can't figure out what formula I need to use.

    Below is an image of what I want, but with a lot less columns.

    Can anyone assist?
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Conditionally formatting a cell only if another cell contains a specific text value.

    Use

    =ISNUMBER(SEARCH(...))

    A successful SEARCH returns the position of the searched word, hence the ISNUMBER.
    A failed SEARCH returns an error, ie not a number.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    05-01-2017
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2016
    Posts
    6

    Re: Conditionally formatting a cell only if another cell contains a specific text value.

    Thanks! I believe that worked!

  4. #4
    Registered User
    Join Date
    05-01-2017
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2016
    Posts
    6

    Re: Conditionally formatting a cell only if another cell contains a specific text value.

    I've been having some issues with the conditional formatting that I created for this table. Like I said, it's for a linked table. I refresh this table everyday. The formatting worked at first but now whenever I refresh my table, the formatting does not show up.

    Do you know if there is a way for me to change this?

+ 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. Conditionally hide row based on specific text in a cell
    By Lorbiculous in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2015, 06:19 PM
  2. Conditionally formatting one cell based on text in another.
    By Jsteelester in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2014, 11:48 AM
  3. [SOLVED] Conditional Formatting to change text in cell if other cell contains specific letter
    By RichTea88 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2014, 06:47 AM
  4. Replies: 1
    Last Post: 08-28-2013, 09:07 AM
  5. Conditional Formatting on Specific Text within a Cell
    By leonfox1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-05-2012, 01:38 PM
  6. Formatting Cell Color to Specific Text
    By andreabeas in forum Excel General
    Replies: 9
    Last Post: 03-25-2009, 03:54 PM
  7. [SOLVED] Formatting text in specific cell
    By tim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2005, 12:20 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