+ Reply to Thread
Results 1 to 10 of 10

Conditional Formatting Shading Rows Based On A Single Cell

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    21

    Conditional Formatting Shading Rows Based On A Single Cell

    Hello everyone,

    I'm trying to create a fill color conditional formula based on a single cell. This cell inhabits for example A1 to A5. Please see attached file as it is easier to see what I'm trying to do than to explain it.


    sample.xlsx


    Thank you!
    Last edited by Kanook22; 08-17-2012 at 12:00 PM. Reason: This was absolutely solved! Thank you so much to all the Excel Gurus!

  2. #2
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    You have zero info in your sheet explaining what you're trying to accomplish. Maybe it is easier to explain it, after all.

  3. #3
    Registered User
    Join Date
    08-08-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    In the spreadsheet, you can see that A7 to A9 and A15 to A16 and shaded. I did this manually using fill color. What I want is to do that in conditional formatting. Obviously I can't do that with a simple =MOD(ROW(),2)=0 formatting.

    For one thing, in column A some cells are merged (ie: A7:A9). So how do I go about doing a conditional format to make it look like the sample spreadsheet without having to do a manual fill color?

    Does that make sense?

  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
    52,936

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    this is the formula i use for what you are trying to achieve, it is based on a value manually entered into a cell in column D. try adjusting the cell references to suite your needs.

    =INDIRECT("d"&ROW())="Outside"
    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

  5. #5
    Registered User
    Join Date
    08-08-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    Thank you very much for the reply. I tried your formula and this is what I got.

    sample2.xlsx

    I modified the spreadsheet to reflect how I want it to look. It looks very close but not quite there yet. I do apologize, as I am very much a novice when it comes to Excel and I certainly appreciate the people that help me in this forum


    Thanks!

  6. #6
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    Select your range, starting with A2. Use this formula for conditional formatting. Change the 1 to a 0 if you want every other row highlighted.

    =MOD(COUNTA($A$2:A2),2)=1

  7. #7
    Registered User
    Join Date
    08-08-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    Thank you BenMiller.

    It didn't quite work. This is the result of what I got using your formula.

    sample2.xlsx

  8. #8
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    Sorry didn't realize you were dragging across columns. Lock the second A :

    =MOD(COUNTA($A$2:$A2),2)=1

  9. #9
    Registered User
    Join Date
    08-08-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    Yup that works. Thank you so very much and have a wonderful day!

  10. #10
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: Conditional Formatting Shading Rows Based On A Single Cell

    No problem Glad I could help ... Appreciate the feedback!

+ 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