+ Reply to Thread
Results 1 to 6 of 6

2 Different Dates but chose the previous date

  1. #1
    Forum Contributor
    Join Date
    04-09-2013
    Location
    Philippines, Manila
    MS-Off Ver
    Excel 2010
    Posts
    140

    2 Different Dates but chose the previous date

    Greetings,

    I have a date that has to be amended every now and then because the date is changing (bcoz of Night Shift), hence, I need to know a formula that.

    IF Time is within 8:00 PM (Aug 15) until 5:00 AM (Aug 16), the Aug 15 will prevail.

    Hope someone could help me.

    Regards

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: 2 Different Dates but chose the previous date

    Try if your now() function or Time in A1

    =IF(HOUR(A1)<5,DATE(YEAR(A1),MONTH(A1),DAY(A1-1)),DATE(YEAR(A1),MONTH(A1),DAY(A1)))
    Click just below left if it helps, Boo?ath?

  3. #3
    Forum Contributor
    Join Date
    04-09-2013
    Location
    Philippines, Manila
    MS-Off Ver
    Excel 2010
    Posts
    140

    Re: 2 Different Dates but chose the previous date

    Got it ^_^

    Thanks buddy.

    Regards

  4. #4
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: 2 Different Dates but chose the previous date

    You are welcome

  5. #5
    Forum Contributor
    Join Date
    04-09-2013
    Location
    Philippines, Manila
    MS-Off Ver
    Excel 2010
    Posts
    140

    Re: 2 Different Dates but chose the previous date

    Hi Boop,

    I know this thread is already close, but I hope you remember this problem. I just encounter one limitation today, since its Sept 1. When I tried to run the formula and the hour is less than 5, the outcome is Oct 1. Is it because of the day-1?

    Regards

  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: 2 Different Dates but chose the previous date

    Try with the below
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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: 1
    Last Post: 08-12-2014, 01:37 AM
  2. [SOLVED] Match dates for first next or previous
    By turist in forum Excel General
    Replies: 5
    Last Post: 05-14-2014, 12:01 PM
  3. How to convert date to number when you chose text
    By hazemrezo in forum Excel General
    Replies: 4
    Last Post: 10-06-2013, 09:26 AM
  4. [SOLVED] VBA Code for Previous dates
    By trosasco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 11:11 AM
  5. Replies: 0
    Last Post: 05-30-2013, 07:50 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