+ Reply to Thread
Results 1 to 15 of 15

Fill cell colour based on another cells contents.

Hybrid View

  1. #1
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Fill cell colour based on another cells contents.

    Hi,
    Here is my issue..

    My range is from col C to AK. Rows 5 to 55

    Rows 16, 18, 20, 22 etc Contain quantities
    Rows 13, 24, 35 etc contain item name

    I have set it so that when there is a number in C18 (quantity) it shows yellow.
    I would like to set it so that if there is a number in C18, C20, C22 then C24 (item name) also shows yellow.
    I have done it with conditional formatting in a single cell, Formula is, =C18:C22>0, format bold and yellow, but I dont want to repeat this hundreds of times for each row and col.

    How do I do this?

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    To follow what you have, in the name box (above the row numbers and left of the column letters) enter C18:AK22. That will select all the rows and columns between C18 and AK22.

    Go to Conditional formatting, New Rule, Use Formula..., and enter this and then go to the formatting and choose the formatting options that you want.
    Formula: copy to clipboard
    =C18:AK22>0


    All columns between C and AK and the rows 18 and 22 will now have the conditional formatting.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    Thanks but this isnt working.
    I'll try to explain better,
    The sheet is in the form of a calendar (thanks Pete)
    C18 contains the quantity of item 1 pulled from an order sheet, D18 is item 2, E18 item 3 and so on
    row 20 is the same for a second order,
    C24 contains the name "item 1" D24 "item 2" etc.

    I just want to highlight the quantity and item for orders to make it easy to see when you glance at it. So if there is no order quantity for an item the item name is white, no fill.
    I managed it for the quantity.
    Is there a way to say "if any entry in the quantity cells them show corresponding item cell yellow"?

    Thanks

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    For Quantity 1, select C18:AK18 (Your original columns msg#1) Enter this formula for the first quantity and format as desired. Any entry will be conditionally formatted.
    Formula: copy to clipboard
    =C18<>""


    For Quantity 2 (row 20) Select C20:AK20 as above.
    Formula: copy to clipboard
    =C20<>""


    For the Item row Select C24:AK24 and enter this formula in Conditional Formatting
    Formula: copy to clipboard
    =OR(C18>0,C20>0)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    Here is a sample of my file.
    Attached Files Attached Files

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    I fail to see how the calendar works. It seems to have little in common with the original question as far as I can see.

    If that is the way that you are doing data entry, that looks like a lot of work for little benefit especially if you have to do that for every month of the year, every year.

    What is this supposed to accomplish? Can you elaborate?

  7. #7
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    The calendar auto fills from an order sheet. I enter items ordered on the order sheet and when they are due. I print the calendar and put it up in the workshop and make the items.
    The reason I want to be able to highlight is when it is printed it will be easy to see the quantity and item.
    I am able to highlight the quantity easily with conditional formatting, but looks like there is no way to highlight the item when there is something in the quantity cell.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    Maybe this is closer to what you want. Values >0 are highlighted and text values are not highlighted except in the bottom row of each section.

    I have no idea if this formatting will be over-written when populated with new data. If "values only" are imported, I would be more confident.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    Thanks,
    Am I right in saying this has to be applied to each cell individually? Or can it be done to the whole sheet?

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    First: select the area E31:AM38 and create the rule
    Formula: copy to clipboard
    =AND(E31<>"",ISNUMBER(E31))

    Second: select E40:AM40 and create the rule
    Formula: copy to clipboard
    =SUM(E31:E38)<>0

    Third: Select E31:AM40 and copy.
    Select E42 and the Paste Special Formats. Repeat this for each block down the worksheet.

  11. #11
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    Thanks, but this doenst work. it fills an entire block of cells if there is an entry.

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    You are doing something wrong or something differs from your sample. There are 0 values in the ranges hidden by a format GENERAL;; and those will be formatted because 0 even though the 0 isn't visible. This not the same as an empty or even a null cell.

    Upload your real file if you can. This file shows the 0 values in cells that were hidden by formatting and are therefore being shown as empty when they are in fact not empty. There are also many cells with an apostrophe and there is no apparent reason for this.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    Brilliant thanks alot. it now works a treat!
    Instead of =AND(E31<>"",ISNUMBER(E31)) I have if cell value is between 1 and 4.
    But it all works well..

  14. #14
    Registered User
    Join Date
    04-10-2016
    Location
    Ireland
    MS-Off Ver
    2003
    Posts
    29

    Re: Fill cell colour based on another cells contents.

    Brilliant thanks alot. it now works a treat!
    Instead of =AND(E31<>"",ISNUMBER(E31)) I have if cell value is between 1 and 4.
    But it all works well..

  15. #15
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Fill cell colour based on another cells contents.

    Glad you got it working. If those 0 values are important, you can change the formatting to GENERAL. If you don't want to see them, do nothing.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 1
    Last Post: 06-20-2014, 05:21 AM
  2. Changing the fill colour of 2 other cells based on another cell's outcome
    By Danny1982 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-29-2014, 11:22 AM
  3. [SOLVED] Format Cell fill based on contents of multiple other cells
    By nsmjc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2013, 03:07 AM
  4. Calculating cells based on fill colour
    By JONNY981 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-21-2013, 11:59 AM
  5. [SOLVED] Combine Cell Contents to with a [return] or [fill with spaces] between each cells contents
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2012, 11:24 PM
  6. Commandbutton code to both erase cell contents, dismiss fill colour and unmerge
    By vdongen in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-03-2010, 10:14 AM
  7. Fill cells with different colors based on different cell contents
    By mdeibel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2010, 10:09 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