+ Reply to Thread
Results 1 to 4 of 4

Date Time Alteration by Formula

  1. #1
    Forum Contributor
    Join Date
    07-22-2013
    Location
    london
    MS-Off Ver
    Excel 2013
    Posts
    133

    Date Time Alteration by Formula

    Hello All


    We have this:
    kvxYcOb.png


    - In A1, we get a data source update that cell every hour with the next hour. Note that the minutes doesn't matter, if the data is updated, the A1 cell should show the next rounded hour. Kind of a "round up".

    -In A2 we just have the formula : =NOW()


    We want to build a cell that show the same data as if we had a successful update, exactly the same as A1 but with a formula to use as a confirmation that the data is the latest. Like:
    =IF(A1=A2,"DATA UPDATED","WARNING, UPDATE FAILED")


    How should be the A2 formula?
    Last edited by nicoan; 05-22-2018 at 10:24 PM.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Date Time Alteration by Formula

    Try:

    =IF(FLOOR(A1,1/24)=FLOOR(NOW(),1/24),"DATA UPDATED","WARNING, UPDATE FAILED")

  3. #3
    Forum Contributor
    Join Date
    07-22-2013
    Location
    london
    MS-Off Ver
    Excel 2013
    Posts
    133

    Re: Date Time Alteration by Formula

    Ah I didn't know I could use rounding in dates.
    I knew the floor function, but it rounds down. The "Ceiling" was the correct round up function.
    I changed it in your formula and it worked.

    Thank you very much Phuocam. Appreciated.

  4. #4
    Forum Contributor
    Join Date
    07-22-2013
    Location
    london
    MS-Off Ver
    Excel 2013
    Posts
    133

    Re: Date Time Alteration by Formula

    Fair enough.

    CEILING is the function that "Rounds Up". (FLOOR is the function that "Rounds Down"). Apparently it could be used in dates too.

    The solution then:

    In A2:
    =CEILING(NOW(),1/24)
    The format must match the one in A1.

    Finally, the IF statement (in another cell) is the same as in the OP:
    =IF(A1=A2,"DATA UPDATED","WARNING, UPDATE FAILED")
    Last edited by nicoan; 05-23-2018 at 10:31 AM.

+ 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: 4
    Last Post: 06-04-2017, 07:34 AM
  2. Replies: 3
    Last Post: 12-19-2013, 06:49 AM
  3. IF/AND Formula Alteration Help
    By quibilty in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-24-2013, 08:12 PM
  4. Formula for Calculating Paid Time Off for fiscal anniversary date real time
    By 168rockwood in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-07-2012, 04:15 PM
  5. [SOLVED] Run-time error '28' Out of stack space - Code alteration help required!
    By PaulThomson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-18-2012, 03:20 PM
  6. Formula Alteration Help
    By hockey99 in forum Excel General
    Replies: 2
    Last Post: 02-29-2012, 01:13 PM
  7. Formula alteration
    By STRATIUS in forum Excel General
    Replies: 6
    Last Post: 05-19-2005, 02:24 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