+ Reply to Thread
Results 1 to 11 of 11

Formula based on two conditions?

  1. #1
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Formula based on two conditions?

    Hi Everyone,

    I need a conditional format that is based on two cells.

    I have a To Do list in Excel; one column is 'Anticipated Date of Task' and the second column is 'Date Completed.'

    If a task is overdue, the entire row turns the font red. So far so good.

    However, if the task is completed, I don't put a date in the 'Anticipated Date of Task' but instead put the date in 'Date Completed.' The problem is that the row font is still red.

    If there a formula I can write that if there is a date in 'Week Completed' it will override the Red format and return is as the normal font?

    I can put a dash in there and it solves the problem, but curious to know if a formula can be written to complete the same thing?

    Thank you,

    Lee.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula based on two conditions?

    Use AND to add the second condition ... Date Completed = ""
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Formula based on two conditions?

    If you post a workbook with sample data and expected results it will be much easier to help you.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  4. #4
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Formula based on two conditions?

    Hello,

    Thanks for getting back to me.

    I've posted the workbook to show you what I mean.

    As you can see in Column E, I have 'Completed' but because column D is blank, it shows are Red Font. However, I would like a formula to consider the completed date in Column F to change the font format to normal.

    The formula conditional formatting I've used is: =$D2< TODAY()

    I assume I can add to this to complete what I want to do?

    Thank you,

    Lee.
    Attached Files Attached Files

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Formula based on two conditions?

    How about this?

    =AND($D2 < TODAY(),$D2 < > "")

    I've added spaces so that I can post the formula here (the forum doesn't like chevrons) - please remove these when you replicate it.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Formula based on two conditions?

    Quote Originally Posted by AliGW View Post
    How about this?

    =AND($D2 < TODAY(),$D2 < > "")

    I've added spaces so that I can post the formula here (the forum doesn't like chevrons) - please remove these when you replicate it.
    Hi,

    Thanks for getting back to me.

    So how does the second part of the formula work?

    I've managed to find a workaround, which is formatting the 'Completed' rule to return normal font formatting. It's worked fine.

    But I'd still like to know how the AND and second part of the formula works.

    Thanks again,

    Lee

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Formula based on two conditions?

    The formula is saying:

    Format cells that are earlier than today AND not equal to blank.

    Syntax:

    =AND(first_criterion,second_criterion,...)
    Last edited by AliGW; 06-30-2019 at 08:30 AM.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula based on two conditions?

    Think it should be this: =AND($D2 < TODAY(),$E2 = "")

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Formula based on two conditions?

    Good spot, Trevor.

    Anything to limit the number of CF rules that the OP needs to set up and maintain. They should be kept to an absolute minimum.

  10. #10
    Registered User
    Join Date
    02-03-2018
    Location
    Manchester, UK
    MS-Off Ver
    2013
    Posts
    76

    Re: Formula based on two conditions?

    Hello,

    Thank you for getting back to me. I appreciated. it.

    Lee.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula based on two conditions?

    You're welcome.

+ 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] Value phasing formula based on several conditions
    By AlisaS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2019, 02:54 AM
  2. [SOLVED] Value phasing formula based on several conditions
    By AlisaS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2019, 05:06 AM
  3. [SOLVED] if formula based on several criteria to extract data based on conditions
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2018, 12:46 PM
  4. [SOLVED] If formula based on multiple conditions
    By Raehan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2017, 09:05 AM
  5. [SOLVED] Formula to Count based in conditions
    By Taislin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-28-2013, 04:55 PM
  6. Keep last records based on conditions, VBA or formula
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2013, 01:45 PM
  7. FORMULA TO ADD AMOUNT BASED ON TWO or MORE CONDITIONS
    By excelkeechak in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-19-2009, 01:25 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