+ Reply to Thread
Results 1 to 8 of 8

Wanted to know if the function "If" works with Today()

  1. #1
    Registered User
    Join Date
    06-05-2014
    Posts
    10

    Wanted to know if the function "If" works with Today()

    I was working on one of the report so that the date automatically appear once we enter the time in another column for different shifts. Was not able to figure it out. Here is the what I was working on if someone could help would be great.

    Shift - 1 8:00 PM - 5:00 AM
    Shift - 2 4:30 AM - 1:30 PM

    IF(AND(A1>="8:00:00 PM"+0,A1<="10:00:00 AM"+0),"Today()",IF(AND(A1>="04:00:00 AM"+0,A1<="2:00:00 PM"+0),"Today()"))

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Wanted to know if the function "If" works with Today()

    Hi,

    Welcome to the Forum.

    Assuming that the timings of shift 1 & 2 are in the range A1:B2, then I believe this the formula is what you are looking out for..
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Format the cells where you use this formula as Date
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  3. #3
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Wanted to know if the function "If" works with Today()

    Saarang84's formula is a more efficient version of yours, but yours would have worked if you took off the double quotes from around Today(). It is a function, so does not need the quotes. Your formula also doesn't have a result for if the condition in the second IF statement is not met, so it would probably return a FALSE response in that circumstance.
    Please add reputation by clicking on the * if I have helped.
    Please mark the thread SOLVED if your issue has been resolved.
    Thanks, Glenn.

  4. #4
    Registered User
    Join Date
    06-05-2014
    Posts
    10

    Re: Wanted to know if the function "If" works with Today()

    Appreciate your respond, Sarang. There was little confusion. I meant there are two shifts (8:00:00 PM to 5:00:00 AM and 4:30:00 AM to 1:30:00 PM). Every time they have worked on the issue within their shift (Shift-1 or Shift-2), they will have to enter the time in G4.
    Example: 1st Issue work at 8:00:00 PM, 2nd Issue at 9:00:00 PM for the Shift - 1, 1st Issue for Shift -2 worked at 4:00:00 AM, 2nd Issue at 6:00:00 AM so on...

    Every agents are using the same formatted excel file for their daily reports and I want the date to be automated because every one comes up with their own date format.

    I've tried this way again after your suggestion but it comes the result as 00/01/00.

    Here is the formula I've used: =IF(OR(AND(G4>="7:00:00 PM"+0,G4<="03:59:00 AM"+0),AND(G4>="04:00:00 AM"+0,G4<="2:00:00 PM"+0)),TODAY(),0)

    Not sure if this would be possible

    Thank you.

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Wanted to know if the function "If" works with Today()

    Hi Eric,

    To fix up the formula for you, I would need to have a look at the layout of the worksheet that is being used by the agents. Can u upload a sample workbook with the layout that is being used (without insensitive data) ?

  6. #6
    Registered User
    Join Date
    06-05-2014
    Posts
    10

    Re: Wanted to know if the function "If" works with Today()

    Hi Saarang,

    I have uploaded the excel file. Hope this will help.

    Thank you.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Wanted to know if the function "If" works with Today()

    Hi Eric,

    I believe what you need is a macro here to insert a Timestamp in appropriate columns in your agent workbook. You can click the Start/Stop button to do the same.

    Before clicking this button, you need to place the cursor in appropriate chat start or chat end time column accordingly.

    If TODAY() function is used in an if condition as you have asked for, it won't retain the previous values. In other words, for an agent who's tracking data in his worksheet everyday, the Date column needs to reflect the appropriate date. To extract the date from the chat time, I've incorporated the formula accordingly. You need to protect the chat start / end time columns for disabling the agent to manipulate the times (to prevent manually editing of the time values).

    Use the below formula for Date (in col D ):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The below code places the current TIMESTAMP when the button is clicked.
    Please Login or Register  to view this content.
    This works in Excel 2003 version as well. Refer workbook attached.
    Attached Files Attached Files
    Last edited by Saarang84; 06-07-2014 at 11:42 PM.

  8. #8
    Registered User
    Join Date
    06-05-2014
    Posts
    10

    Re: Wanted to know if the function "If" works with Today()

    Saarang,

    You are great! Thank you so much. That work now. I think, I will need to learn some Visual Basic Editor or macros.

+ 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. [SOLVED] Pasting values between ranges in different workbooks: "Range" works but "Cells" doesn't
    By Flaubert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2013, 01:19 PM
  2. "IF()" function using "TODAY()" to produce a value in days
    By Rob.Marchel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2012, 09:12 PM
  3. [SOLVED] Variable "sheet-name" and "range-name" wanted in INDEX/MATCH-function
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2012, 04:09 PM
  4. [SOLVED] "NOW" or "TODAY" date function
    By Chris in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-19-2006, 02:50 PM
  5. [SOLVED] How can I use the "TODAY ()" Function in an "IF/THEN" calculation
    By Rodney in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2006, 05:20 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