+ Reply to Thread
Results 1 to 8 of 8

Need If/Then Formula That Changes With Time

  1. #1
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Need If/Then Formula That Changes With Time

    Hello,
    Can anyone help me with the following problem? I need a (IF/Then) formula that would paste the same number into a column from 0:00 to 23:00 and change the next day at 0:00 and do the same thing until the next 0:00. The data to be change every 24 hours is in Sheet1 and the date and time is in Sheet2. I attempted to use a formula that only recognizes 0:00 but with 23 spaces between days the next cell pasted is not the 2nd day. Please see the attached spreadsheet and any all help is greatly appreciated. Thank You.
    Attached Files Attached Files
    Last edited by artiststevens; 12-12-2010 at 08:20 AM. Reason: Title Change

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: Need If/Then Formula That Changes With Time

    Can you format 2010.1.4 as a date?
    Never use Merged Cells in Excel

  3. #3
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need If/Then Formula That Changes With Time

    Quote Originally Posted by zbor View Post
    Can you format 2010.1.4 as a date?
    I don't think so... I was more concerned with it changing at 0:00. The date format is no that important.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: Need If/Then Formula That Changes With Time

    Here, try this:

    =VLOOKUP(DATE(LEFT(A2,4),MID(A2,6,2),RIGHT(A2,2)),Sheet1!$A$2:$C$14,3,FALSE)
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Need If/Then Formula That Changes With Time

    as an alternative to the Date part of the formula

    DATEVALUE(SUBSTITUTE(A2,".","/"))

    less references!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Need If/Then Formula That Changes With Time

    Another way

    Please Login or Register  to view this content.

    I have put this and the option if you can change column A to dates formatted "yyyy.mm.dd"

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need If/Then Formula That Changes With Time

    Quote Originally Posted by zbor View Post
    Here, try this:

    =VLOOKUP(DATE(LEFT(A2,4),MID(A2,6,2),RIGHT(A2,2)),Sheet1!$A$2:$C$14,3,FALSE)
    That worked like a charm! Thanks Zbor!

  8. #8
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need If/Then Formula That Changes With Time

    Thanks Marcol and squiggler47's! All of your help is greatly appreciated!

+ 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