+ Reply to Thread
Results 1 to 8 of 8

Formula for a column fill color based on another column content

  1. #1
    Registered User
    Join Date
    10-29-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    10

    Formula for a column fill color based on another column content

    Hello everybody
    I have a question .Just take a look to picture I have attached. I want to write a formula for entire of
    "O" column for its cells fill color, based on "M" column cells value, If the value in "M" be 1, the
    Cell fill color in "O" column in the same row change to YELLOW, if value be 2, color in "O" change to
    RED and...
    Also with changing the cell fill color can we change its fonts color to a bold withe color for example?
    Thank you in advanced.


    \1

    http://www.mrexcel.com/forum/excel-q...ml#post4669659
    Last edited by baloot21; 11-01-2016 at 02:49 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula for a column fill color based on another column content

    First, your picture is such a low resolution that it is nearly illegible. An image attachment has very little value. Just attach the Excel file. It's easier than taking a screenshot first and then attaching that. Under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.

    You also have other colors in column O. Can you give all the rules you need?

    You will need one conditional formatting rule for each color that you want in column O. Highlight the cells in O that you want the rule for (O2 up to the highest row you might use) and then go into Conditional formatting and select "Use a formula...". For example, for M=1:

    =M2=1

    and use the yellow fill color and bold font formatting.

    If you attach your file I can implement this in your file for you as an example, then you can do the rest.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-29-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    10

    Re: Formula for a column fill color based on another column content

    Hello jeff and thank you for your reply.
    I only need 4 colors for column "O" . for example if "O" =1 them "M" = yellow if "O" = 2 then "M"= RED if "O" =3 then "M" = green and if "O" = 4 then "M" = brown
    I whant to change font color in dark backcolor fill for example with RED fill I like BOLD white font.
    Thank you.
    p.s :I attached that excel file named "for net".
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-29-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    10

    Re: Formula for a column fill color based on another column content

    How can I use conditional formating for column "O" based on column "M" ?

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Formula for a column fill color based on another column content

    CF formula

    Select O2

    ... Use a formula....

    =m2=1

    Fill==> Yellow

    Applies to: $O$2:$O$200

    Repeat for m= 2 to 4
    Last edited by JohnTopley; 10-29-2016 at 10:38 AM.

  6. #6
    Registered User
    Join Date
    10-29-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    10

    Re: Formula for a column fill color based on another column content

    Hello again and thanks all of you. I found my answer from somebody(Marcilio) and it works!
    In this formula the header of column "M" which is M1 is considered so each rule applys to all
    of cells in the column "M" and it is very nice I only need to creat 4 rules.

    The answer :

    The Conditional Formatting will do this task for you.
    Try to use:

    Select Colunm O
    Conditional Format Menu --> Using Formula

    Rule 1
    =$M1=1
    Format:Font Bold; Fill Color YELLOW
    OK

    Rule 2
    =$M1=2
    Format:Font Bold; Font color White; Fill Color RED
    OK

    Rule 3
    =$M1=3
    Format:Font Bold; Fill Color GREEN
    OK
    Create as many rule as necessary for your different Values.
    Last edited by baloot21; 10-29-2016 at 02:29 PM.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Formula for a column fill color based on another column content

    baloot21, we have a rule that if you post the same thread to another forum, you must tell us this in your thread here. In this case you have at least two people here trying to help you when you have gotten an answer someplace else that we didn't know about.

    http://www.mrexcel.com/forum/excel-q...s-content.html

    Please take the time to review our rules. There aren't many, and they are all important.

    Your post does not comply with Rule 8 of our Forum Rules: Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you must provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (most other forums have the same rule).

  8. #8
    Registered User
    Join Date
    10-29-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    10

    Re: Formula for a column fill color based on another column content

    "baloot21, we have a rule that if you post the same thread to another forum, you must tell us this in your thread here. In this case you have at least two people here trying to help you when you have gotten an answer someplace else that we didn't know about."

    Hello Admin , The RED word are not true . As soon as I found the answer , I told to you in 6th post .
    Anyway I did not know your rule8 and sorry.
    Regards.

+ 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. [SOLVED] Fill color top most row and leftmost column based on selected cell
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2016, 09:09 PM
  2. Replies: 5
    Last Post: 02-18-2016, 12:51 PM
  3. fill in formula based on column content
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2015, 10:01 PM
  4. Count column value then adjacent column cell fill color
    By MIGARDEIN in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-09-2015, 01:13 AM
  5. Replies: 3
    Last Post: 10-17-2014, 02:29 PM
  6. [SOLVED] Auto fill a column based on date and color a column if past that date
    By thegunder in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2013, 03:06 PM
  7. Color column range based on content in fixed cell
    By xxxyyyy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2009, 01:52 AM

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