+ Reply to Thread
Results 1 to 13 of 13

Excel 2007 : Color Range of Cells Based upon Value in Another Cell

  1. #1
    Registered User
    Join Date
    12-16-2011
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Color Range of Cells Based upon Value in Another Cell

    In a Pivot Table I have a column showing Current Age, 1-37, for a number of different Rooms across the top, A-ZZ, and I want to be able to look at the value in Current Age column for a particular row and have it auto fill in twelve cells of that row a certain color based upon the age.

    Say if the Current Age is 1 in Row 44, I want to have the values in E44:T44 shaded yellow. If the current Age is 13 in Row 32, I want to have the values in E32:532 shaded green. How might I accomplish this?

    Current Age RoomA Room B Room C, etc
    Row 32 13 0 6 10 (want this shaded green because Age is 13)
    Row 44 1 3 9 5 (want this shaded yellow because Age is 1)

    Does this make sense? Any help would be appreciated. Thanks.

    Kalli

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Color Range of Cells Based upon Value in Another Cell

    Hi Kalli and welcome to the forum.

    For me is not clear what are you asking for!

    Row 32 13 0 6 10 (want this shaded green because Age is 13)
    Row 44 1 3 9 5 (want this shaded yellow because Age is 1)
    IN A32, the age is 13. OK. Then in conditional formating(you mark all the cells first--E32:T32) AND TYPE THIS formula: A32=13>>choose colour>>OK

    Is this, what are you looking for??? I don't think so...

    But you said that you have 37 ages.
    With Conditional formating, you can use only 3 conditions...so 3 colours...

    I think that the best way to describe your problem, is to attach a sample workbook.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    12-16-2011
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Color Range of Cells Based upon Value in Another Cell

    I've attached the file showing what I would like to occur using conditional formatting. Maybe it is not possible. Thanks.

    K
    Attached Files Attached Files

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Color Range of Cells Based upon Value in Another Cell

    ..So good news

    We can do it using Conditional Formating.

    Take a look to the attachement.

    Hope to helps you.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Color Range of Cells Based upon Value in Another Cell

    Just an addition,

    If you have any text In B8:B44 this will color as green, because texts are greater than numbers. So use the condition for green as,

    =AND(N($B8),$B8>25)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  6. #6
    Registered User
    Join Date
    11-30-2011
    Location
    Southern California
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Color Range of Cells Based upon Value in Another Cell

    Very nice, can I also use this to highlight a row only if one of the cells in the row are populated with a number larger than 0?

  7. #7
    Registered User
    Join Date
    12-16-2011
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Color Range of Cells Based upon Value in Another Cell

    I appreciate the input. What I would like to have done is evaluate the number in each cell from B8 to B44 and color the remainder of that particular row based upon the value in the B cell.

  8. #8
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Color Range of Cells Based upon Value in Another Cell

    Select C8:R44, then use these formulas in CF,

    For green,

    =AND(N($B8),$B8>25,N(C8)>0)

    For Blue,

    =AND($B8>=13,$B8<=25,N(C8)>0)

    For Pink,

    =AND(N($B8),$B8<=12,N(C8)>0)

  9. #9
    Registered User
    Join Date
    12-16-2011
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Color Range of Cells Based upon Value in Another Cell

    That worked perfectly. Thank you. I was using the ColorFunction formula to count the values in the cells shaded, say, green and now that functionality seems to have disappeared after using the conditional formatting. Any idea why this would occur?

  10. #10
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Color Range of Cells Based upon Value in Another Cell

    The Colorfunction will count only colored manually NOT via Conditional Formatting.

    Try these formulas instead.

    For Green,

    =SUMPRODUCT((B8:B44>25)*ISNUMBER(B8:B44)*ISNUMBER(C8:R44)*(C8:R44>0))

    For Blue,

    =SUMPRODUCT((B8:B44>=13)*(B8:B44<=25)*ISNUMBER(C8:R44)*(C8:R44>0))

    For Pink,

    =SUMPRODUCT((B8:B44<=12)*ISNUMBER(C8:R44)*(C8:R44>0))

  11. #11
    Registered User
    Join Date
    12-16-2011
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Color Range of Cells Based upon Value in Another Cell

    Instead of counting the number of occurrences, can you help me out with how to make it sum the values instead? I don't understand SUMPRODUCT OR ISNUMBER.

  12. #12
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Color Range of Cells Based upon Value in Another Cell

    Green,

    =SUMPRODUCT((B8:B44>25)*(C8:R44))

    Blue,

    =SUMPRODUCT((B8:B44>=13)*(B8:B44<=25)*(C8:R44))

    Pink,

    =SUMPRODUCT((B8:B44<=12)*(C8:R44))

  13. #13
    Registered User
    Join Date
    12-16-2011
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Color Range of Cells Based upon Value in Another Cell

    You're the best. Thank you so very much!

+ 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