+ Reply to Thread
Results 1 to 6 of 6

Set Cell Color based on a formula

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Ridgefield, CT, US
    MS-Off Ver
    microsoft office 365 pro plus - EXCEL
    Posts
    3

    Question Set Cell Color based on a formula

    I am looking for a method to set the color of a cell based on where the cell value originated from:

    i have this formula: =if(a8-b8)>0, c8,d8) and values coming from C column should be blue and values from D column should be pink.
    how do i do that please?
    see attached spreadsheet
    thank you for your help

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Set Cell Color based on a formula

    you should be able to use the same sort of formula in a conditional format

    =(a8-b8)>0
    set to Blue

    =(a8-b8)<=0
    set to pink

    see attached
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    Ridgefield, CT, US
    MS-Off Ver
    microsoft office 365 pro plus - EXCEL
    Posts
    3

    Re: Set Cell Color based on a formula

    Hi Etaf, Thank you. That works
    one more question please: is there a function to actually "set" the color of a cell please like =XXX(A1, BBB,CCC) where XXX is the function name, BBB the cell attribute (here color) and CCC the value that sets teh attribute here CCC could be a number/text value for blue and pink

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Set Cell Color based on a formula

    No, there is no way, through just formulas to set cell formatting like bold, superscript, font color, background, underlines, etc. You need to work through Conditional Formatting or VBA
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    08-18-2015
    Location
    Ridgefield, CT, US
    MS-Off Ver
    microsoft office 365 pro plus - EXCEL
    Posts
    3

    Re: Set Cell Color based on a formula

    Thank you for your kind answer.

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,743

    Re: Set Cell Color based on a formula

    glad its worked Ok for you
    if my assistance has helped, and only if you wish to , there is a reputation icon * on the left hand side - you can add to my reputation here

+ 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. Color tab based on cell value but ignore formula
    By freeon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2013, 03:41 PM
  2. Change Cell color based on greater than, less than formula
    By Directorboy in forum Excel General
    Replies: 2
    Last Post: 03-07-2013, 11:18 AM
  3. Replies: 1
    Last Post: 02-15-2013, 08:14 PM
  4. formula to set font color based on value in other cell
    By happycats in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-03-2009, 01:08 PM
  5. formula based on cell background color
    By seyah in forum Excel General
    Replies: 2
    Last Post: 05-11-2007, 05:20 PM
  6. How do I change color pattern based upon a formula within a cell?
    By aemuk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-16-2006, 06:25 PM
  7. [SOLVED] How do you fill a cell with a color based on IFTHEN formula?
    By ctbowling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2006, 11:15 AM
  8. Change a cell's color based on return value of a formula
    By Gee-off in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2005, 10:10 AM

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