SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    Bowen Mountain, NSW
    Posts
    490
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can a formula change background colour in excel?

    G'day to all,

    I am currently working on an excel spreadsheet and I have formula working out a difference of 2 columns.

    Can a formula result change the background colour depending on the result given?

    E.G:
    If cell > 0.1%
    then background colour = green
    else
    background colour = red
    Regards,
    BJ Duncan

  2. #2
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,359
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I remember doing this with macros but from memory formulas themsleves can't alter formatting.

  3. #3
    SitePoint Wizard silver trophy rushiku's Avatar
    Join Date
    Dec 2003
    Location
    A van down by the river
    Posts
    2,056
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    It's called 'Conditional Formatting', here's how to do it.

  4. #4
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    Bowen Mountain, NSW
    Posts
    490
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers thanks very much rushiko, fantastic resource. Many thanks.
    Regards,
    BJ Duncan

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I remember doing the same. The one thing I could never figure out was how to change the background colour other cells that do not contain the value (e.g. changing the background colour of an entire row based on one value in that row). If you happen to figure it out, I'd appreciate it if you'd let me know.

  6. #6
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    Bowen Mountain, NSW
    Posts
    490
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way I was able to make the whole row format was to merge all the cells, but that only permits one result in the merged cell.

    Don't know if this helps or not, but I couldn't work any other way as the conditional formatting does not allow you to select the particular cells you want formatted, it only allows you to use the cell that has been selected to do the formatting on.
    Regards,
    BJ Duncan

  7. #7
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought so. Thanks for the reply.

    I'm sure someone has come up with some long winded way of doing it maybe through VB.

    Good luck with the rest of your project.

  8. #8
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    Bowen Mountain, NSW
    Posts
    490
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Limotek View Post
    Good luck with the rest of your project.
    Cheers thanks. I will keep my eye out and if I come across anything I will PM you with the details.
    Regards,
    BJ Duncan


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
  •