+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting

  1. #1
    Registered User
    Join Date
    05-28-2008
    Posts
    49

    Conditional Formatting

    I have column A containing numerical data. Some of the cells in this column are highlighted / filled in a yellow color. Other cells in this column have no color format.

    Is there a formula that can be created to look at the data in column A and if a cell is highlighted yellow, an asterisk (*) is placed in column B in the same row?

    If the cell in column A is not highlighted yellow, then the formula does nothing.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Conditional Formatting

    There is no built-in formula to determine the fill color of a cell. You would have to use VBA.

    However, what is the criteria that caused some cells to be filled with yellow, even if it was done manually?

    A formula could be developed if the criteria are known. Tell us more or upload a sample workbook.

  3. #3
    Registered User
    Join Date
    05-28-2008
    Posts
    49

    Re: Conditional Formatting

    Column A contains amounts - many of which net to zero (i.e. there is a debit for $10 in one cell and a credit for $10 in the cell below).

    For those amounts that net to zero, I have manually highlighted yellow.

    I would like a way to identify cells that are not highlighted yellow without manual effort (I was thinking of placing an * in the adjacent column so that I could resort the data and group all the cells that net to zero).

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formatting

    Actually there are some new color-detecting capabilities in Excel 2007. Since you have not filled out your forum profile nor indicated IN your post what version you're using, Excel 2007 users will most likely not offer assistance from these new features.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional Formatting

    so a formula like =if(a1-a2=0,"*","") would work?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Formatting

    Quote Originally Posted by Cheeky Charlie View Post
    so a formula like =if(a1-a2=0,"*","") would work?
    That would only work if the +/- entries appeared directly next to each other, which I am sure it not the case.

    1) Put this formula in B2 and copy down. It will put a * in every cell that has an opposing match nearby. You can only copy this formula downward.

    =IF(A2=0, "", IF(A2<0, IF(COUNTIF($A$1:A2,A2)=COUNTIF($A$1:$A2,-$A2), "*", ""), IF(ISNUMBER(MATCH(-A2,A2:$A$10000,0)), IF(INDEX(B2:$B$10000,MATCH(-A2,A2:$A$10000,0))="*", "*", ""), "")))

    2) The manual highlighting of matching rows is not necessary. With this formula in place, you could now use a conditional formatting rule to turn the cells yellow automatically if a * is in the adjacent B column.
    Attached Files Attached Files
    Last edited by JBeaucaire; 09-11-2009 at 09:37 AM.

+ 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