+ Reply to Thread
Results 1 to 4 of 4

Complex conditional formatting

Hybrid View

  1. #1
    Registered User
    Join Date
    04-18-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Lightbulb Complex conditional formatting

    Hopefully this is easy for somebody and they can help.............

    I have a row of 6 cells with numeric values
    The 6th cell in the row is an auto sum of cells 1-4 in the row

    When I add a colour to the 5th cell in the row (e.g. 'fill colour' in yellow), I would like the numeric value of the 5th cell automatically to be added into the auto sum of the 6th cell in the row.


    Is this even possible?

  2. #2
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Complex conditional formatting

    Is the 5th cell being colored conditionally, and if so what is the condition? Averageifs might be an option. If you simply want a formula that will detect a colored cell, that is outside of my knowledge base.

  3. #3
    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: Complex conditional formatting

    Hi,

    I know of no way with standard excel functionality to detect a cell colour change. You could use a UDF

    e.g.

    Function cell5(r As Range)
        Application.Volatile
        If r(1, 5).Interior.ColorIndex = 6 Then
            cell5 = WorksheetFunction.Sum(r)
        Else
            cell5 = WorksheetFunction.Sum(r.Resize(1, 4))
        End If
    
    End Function
    In the 6th cell in the row enter

    Formula: copy to clipboard
    =cell5(A1:E1)


    The only downside to this is that the sum won't immediately change when you colour the 5th cell yellow. You will need to do a recalc. i.e. by hitting the F9 key, edit and entering a cell, clicking on a row or column dividing line or one of the several other ways to calculate the sheet.
    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.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Complex conditional formatting

    If you cannot use Richard's suggestion, then instead of using a color, use another column to add a x (or whatever), then build a test in your formula for that
    =sum(A1:A4)+if(B4="x",B5,0)
    (Im sure there a tons of variations for that)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 6
    Last Post: 03-12-2006, 06:30 PM
  2. [SOLVED] complex?? Q about Conditional formatting
    By AngelaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. complex?? Q about Conditional formatting
    By AngelaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  4. [SOLVED] complex?? Q about Conditional formatting
    By AngelaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. complex?? Q about Conditional formatting
    By AngelaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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