+ Reply to Thread
Results 1 to 4 of 4

Formula to change colour of a cell based on info in two diffrent cells.

  1. #1
    Registered User
    Join Date
    04-17-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    4

    Formula to change colour of a cell based on info in two diffrent cells.

    Hi Guys, Are you able to help me with the formula for the following.
    jones start date 13th of April 2019.
    Smith terminate date 29th may 2019.

    I need a formula to change colour based on information in two cells In excel

    All cells prior to 13th April for Jones and all cells after 29th may 2019 for Jones.

    i don't think i am explaining this fully. i Cant attached a copy of the excel spread sheet to is post.
    Last edited by Charli07; 04-20-2019 at 06:36 AM.

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Formula to change colour of a cell based on info in two diffrent cells.

    You can do this with Conditional Formatting.
    1. Select your range (the range you want to format).
    2. On the Home tab of the ribbon, click 'Conditional Formatting', then 'New Rule', then 'Use a formula to determine which cells to format'.
    3. In the formula box, enter one of the formulae detailed below.
    4. Click 'Format' then choose the colour you want from the 'Fill' tab.
    5. Click OK twice to get back to the worksheet.

    What formulae you want depends on how your sheet is structured. The generic structure will be something one of these for Jones:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For Smith, replace the < sign with > (as well as changing Jones to Smith and changing the date if using the second one, obviously).

    Attached is a file showing the first type of formula working, with Names and Start/Terminate dates in columns A-C, then a list of names and dates in columns E and F. The formulae used in the CF are shown in columns G (for Jones) and H (for Smith) - these are just for reference, they're not actually needed, as they're in the CF.
    Note the $ signs used for the cell references. For example $E2 makes sure that the formatting always looks at column E to match 'Jones' or 'Smith', and the $A$2 always refers to Jones' start date.

    Your sheet is bound to be structured differently, but hopefully you can adapt this.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Registered User
    Join Date
    04-17-2019
    Location
    london
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Formula to change colour of a cell based on info in two diffrent cells.

    Thanks Aardigspook,

    that is not what I meant.

    I have a work book which will explain better. however I am not able to attach that file.
    Attached Files Attached Files
    Last edited by Charli07; 04-24-2019 at 01:59 PM. Reason: attache workbook

  4. #4
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Formula to change colour of a cell based on info in two diffrent cells.

    You can use the following conditional formatting formula. Please note that you would need to recreate it for each sheet, as I don't think there's a way to get conditional formatting formulas to apply to more than one sheet:
    Please Login or Register  to view this content.
    In the Applies to box, select $D$4:$AG$5. You'll obviously need to adjust your ranges to fit the actual data. Does this provide the results you need?
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

+ 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] Change Colour for Blank Cells based on date in another cell
    By LMills77 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-04-2018, 06:33 PM
  2. How to change cell colour, if the colour is based on value from formula?
    By darah237 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2016, 11:40 AM
  3. Change colour of cells based on another cell's colour (Not value)
    By LTrain89 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2013, 08:44 PM
  4. Change cell colour, based on matched cells in sheet 2
    By Bobbo Jones in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-14-2013, 02:27 AM
  5. Change Colour of 3 Cells based on Value of Other Cell
    By hazza147 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2010, 05:57 AM
  6. Change colour of cells based a cell?
    By smogsy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2010, 09:22 AM
  7. change a cell colour via a diffrent cell
    By garethtaylor in forum Excel General
    Replies: 7
    Last Post: 11-23-2009, 04:09 PM

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