+ Reply to Thread
Results 1 to 8 of 8

Conditional formatting based on two cell values

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Smile Conditional formatting based on two cell values

    Hi all,

    I want to do conditional formatting based on two cell values.

    i want to do conditional format the column 'R' based on clolumns 'J' and 'R'.
    column 'J' is a text column named PRIORITY which can hold the values P1,P2,P3 an P4.
    Column 'R' is nothing but difference of two columns 'M' and 'H'(both are time stamps).Column'R' is in below format.
    =TEXT(M4-H4,"h:mm:ss").

    column M and H are in below format:

    eg: 9/11/13 9:41 AM


    Now i want to format the column'R' like
    if column J ="P2" and column 'R' > "00:10:00"(10 mins) =it should become red.
    if column J="P3" and column 'R'>"00:30:00"(30 mins) = it should become red.

    thanks in advance

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional formatting based on two cell values

    Hi and welcome to the forum

    If R is =TEXT(M4-H4,"h:mm:ss"), then this is text, and you cannot perform math functions on text What I would suggest is to use the actual formula inside there (=M4-H4) in your CF rule

    Perhaps it would be easier to offer a better suggestion is you provided a sample workbook with dummy data, showing a few samples of your expected outcome?
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Conditional formatting based on two cell values

    Hi FDibbins,

    I have uploaded the sample excel sheet.
    please check that, it will be helpful for you to give a solution.
    Thanks for your quick response.
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional formatting based on two cell values

    Thanks for the file.

    1st, unless you have a specific reason for needing the calc in E to be text, you can just use =D2-B2 copied down (format as needed, although excel will probably format it correctly for you.

    2nd, try this formula in your CF rule...
    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =OR(AND(C2="P3",E2>30/60/24),AND(C2="P2",E2>10/60/24))

  5. #5
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Conditional formatting based on two cell values

    Hi FDibbins,

    I did the changes in column E, what you mentioned.
    and i tried the CF rule.

    But its not working

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional formatting based on two cell values

    Check what you did. When I used that, it high-lighted E10 and E12 red.

    Follow my instructions for applying the CF rule

  7. #7
    Registered User
    Join Date
    09-21-2013
    Location
    chennai,India
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Conditional formatting based on two cell values

    Thanks FDibbins,

    Its working great...

    is there any conditiional formatting with colours?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Conditional formatting based on two cell values

    Yes, when you format under CF, click the "FILL" tab and you can specify colors there

+ 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] Conditional Formatting Based on Values in another Cell
    By jdegeorge in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-12-2013, 02:35 PM
  2. Conditional Formatting based on 3 different cell values
    By Stephen.Birch in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-21-2013, 10:16 AM
  3. Conditional Formatting based on cell values
    By nickbrandon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 08:26 AM
  4. Conditional Formatting based on several cell values
    By jpruffle in forum Excel General
    Replies: 3
    Last Post: 09-28-2009, 08:02 AM
  5. [SOLVED] conditional formatting based on values of another cell
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2005, 04:05 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