+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23

Thread: Formula to compare and amend date and time

  1. #16
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    MS Excel 2010
    Posts
    2,252

    Re: Formula to compare and amend date and time

    =IF(D2+TEXT(E2,"00\:00")>F2+TEXT(G2,"00\:00"),"Early",IF(D2+TEXT(E2,"00\:00")<F2+TEXT(G2,"00 \:00")-"03:00","Late",""))

  2. #17
    Registered User
    Join Date
    05-11-2010
    Location
    Boston, UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula to compare and amend date and time

    Thanks a ton!

    That works a treat.. You are a gem!

    I do not have enough words to thank you..

  3. #18
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Formula to compare and amend date and time

    Saajan,

    maybe you have a little breath left to mark the thread as solved.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  4. #19
    Registered User
    Join Date
    05-11-2010
    Location
    Boston, UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula to compare and amend date and time

    Oops.. Sorry.. Was too excited!!! Will do that straight away.. Thanks!

    EDIT: I am unable to edit any of my previous posts for some reason
    Last edited by Saajan; 06-01-2010 at 11:19 AM.

  5. #20
    Registered User
    Join Date
    05-11-2010
    Location
    Boston, UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula to compare and amend date and time

    This is an extension of the same issue, so I wasn't sure if I had to create a new post.

    Admin, if it needs to be a new post, please feel free to move it or guide me in doing so.


    Ok.. Here is the problem...

    How should the same formula be amended if column 'E' is in the time format 00:00:00 and column 'G' is formatted as general?

    I tried to remove the time formatting from column 'E' and for some reason, it doesn't seem to like it. When I format it as text, it gives me some decimal values like 0.5, 0.3333, etc. I tried changing the formats in different ways, but still doesn't seem to work.

    I would appreciate if you could show me some way of removing the time formatting or may be amend the formula so that it works with this format.

    I hope I made sense with what I was trying to explain.

    Any help would be greatly appreciated.. Many Thanks!

  6. #21
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Formula to compare and amend date and time

    I think you will need to provide more detail.

    Time in Excel is a Decimal value - ie 1 day (or 24 hours) equates to 1.0, thus 12 hours equates to 0.5, 6 hours 0.25 and 18 hours 0.75 etc...

    If your values are both true Time values but one is formatted as Time and the other as General both values remain valid Times in their own right.
    The underlying values are important, the formatting is irrelevant in such situations and you can disregard this concern accordingly.

    IF your "Time formatted value" is using the Custom Format route previously discussed on this thread (ie entering 1230 appears as 12:30) then you must still account for this.

    If in doubt, post a sample file.

  7. #22
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    MS Excel 2010
    Posts
    2,252

    Re: Formula to compare and amend date and time

    Use

    =IF(D2+E2>F2+TEXT(G2,"00\:00"),"Early",IF(D2+E2<F2+TEXT(G2,"00 \:00")-"03:00","Late",""))

  8. #23
    Registered User
    Join Date
    05-11-2010
    Location
    Boston, UK
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Formula to compare and amend date and time

    Quote Originally Posted by Bob Phillips View Post
    Use

    =IF(D2+E2>F2+TEXT(G2,"00\:00"),"Early",IF(D2+E2<F2+TEXT(G2,"00 \:00")-"03:00","Late",""))

    Thanks a lot Bob.. That seems to be working.. You are simply great!

    I have added you reputation.

    Many Thanks again!


    PS: Can admin/mod please mark this as SOLVED as I am unable to do so. Thanks!
    Last edited by Saajan; 06-03-2010 at 05:14 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0