+ Reply to Thread
Results 1 to 8 of 8

How to use an IF statement to evaluate two different cells with a number and a date

  1. #1
    Registered User
    Join Date
    09-21-2006
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365 Subscription
    Posts
    56

    How to use an IF statement to evaluate two different cells with a number and a date

    Here is my problem:

    I have a cell, C3, which contains a number (number of reports). On a different sheet I have the reports with a cell that returns the most recent report date (max function).

    We'll use December for the example.

    On the report sheet, REPORTS, there are 5 reports with the most recent date of 12/8/12.

    ON the main sheet, SUMMARY, the report number cell for the report type contains 3.

    I need to format another cell on the SUMMARY sheet which will return the letter D if 1) the number of reports is less than 2 and 2) if the date of last report is 1 week prior to December 31, 2012.

    Is this possible?

  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,936

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    try something lik ethis...
    =if(and(cell-ref>2,"D",cell-with-report-date<DATE(12,12,24)
    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-2006
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365 Subscription
    Posts
    56

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    That doesn't seem to work for me..

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    =if(and(#of report<=2, date last report < date-7),"D","")
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Registered User
    Join Date
    09-21-2006
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365 Subscription
    Posts
    56

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    Not returning anything...Here is what I have for the formula:

    =if(and(A5<=2,UAL801!O17>12/31/12-7),"D","")

    O17 is 12/25/12 (for testing purposes only). Should have a D. When I change the date to 12/23/12 should have nothing but I am getting nothing.

    What am I doing wrong. Starting to drive me nuts...

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    A1 =12/31/12

    =if(and(A5<=2,UAL801!O17 > A1-7),"D","")

  7. #7
    Registered User
    Join Date
    09-21-2006
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365 Subscription
    Posts
    56

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    Works like charm..Thanks vlady..

  8. #8
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to use an IF statement to evaluate two different cells with a number and a date

    Welcome.
    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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