+ Reply to Thread
Results 1 to 6 of 6

Issue with date formulas

  1. #1
    Registered User
    Join Date
    08-07-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2016
    Posts
    10

    Issue with date formulas

    Hi!

    Fairly new to formulas so forgive me if this is a stupid question

    What I'm trying to do is have a cell return a 1 if U3 equals yesterday's date, return a 2 if U3 is more than 1 day greater than yesterday's date, or return a 0 if neither of these are true. I've used the following formula:

    =IFERROR(IF(TODAY()-1=INT(U3),1,IF((TODAY()-U3)>1,2),0))

    Can attach a sample of the spreadsheet if necessary.

    Thanks!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,500

    Re: Issue with date formulas

    What EXACTLY is in cell U3? Is it a date or text? Is it entered manually or derived from a formula?

    The spreadsheet would make it easier to diagnose.
    Ali


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


    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.

  3. #3
    Registered User
    Join Date
    08-07-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2016
    Posts
    10

    Re: Issue with date formulas

    Hi Ali,

    U3 is a manually entered date - a target go-live date for a campaign.

    Have attached the spreadsheet I'm working on.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    22,819

    Re: Issue with date formulas

    Try

    =IF(TODAY()-1=U3,1,IF(TODAY()-U3>1,2,0))

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    22,819

    Re: Issue with date formulas

    In W3

    =IF(ISNUMBER(U3),IF(TODAY()-1=U3,1,IF(TODAY()-U3>1,2,0)),"")

    in X3

    =IF(ISNUMBER(W3),IF(OR(AND(W3*1=1,Y3=1,M3=1),AND(W3*1=0,Y3=0,M3=1)),1,IF(AND(W3*1=1,Y3=0,M3=1),2,IF(W3=2,3,0))),"")

  6. #6
    Registered User
    Join Date
    08-07-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2016
    Posts
    10

    Re: Issue with date formulas

    Quote Originally Posted by JohnTopley View Post
    In W3

    =IF(ISNUMBER(U3),IF(TODAY()-1=U3,1,IF(TODAY()-U3>1,2,0)),"")

    in X3

    =IF(ISNUMBER(W3),IF(OR(AND(W3*1=1,Y3=1,M3=1),AND(W3*1=0,Y3=0,M3=1)),1,IF(AND(W3*1=1,Y3=0,M3=1),2,IF(W3=2,3,0))),"")
    This works perfectly! Thank you!

+ 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: 0
    Last Post: 11-16-2015, 08:57 AM
  2. [Not an issue, just feedback] Am I being efficient with my formulas?
    By svalentine91 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-07-2013, 04:57 PM
  3. Issue Using Array Formulas
    By apiekar42 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-07-2013, 02:22 PM
  4. Excel to PDF with formulas issue
    By nross in forum Excel General
    Replies: 0
    Last Post: 11-28-2012, 01:47 PM
  5. 2 formulas in one cell issue
    By Bryy2001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2012, 03:55 PM
  6. C# Issue with Existing Formulas
    By Weezy1188 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-03-2010, 12:46 AM
  7. Issue with Formulas (COMPLEX)
    By aeddipa in forum Excel General
    Replies: 2
    Last Post: 06-26-2009, 05:36 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