+ Reply to Thread
Results 1 to 8 of 8

Thread: Time calculation

  1. #1
    Forum Contributor
    Join Date
    12-08-2005
    Location
    Silicon Valley, CA USA
    Posts
    194

    Time calculation

    Hi,
    I have in cell A1 date and time value (6/09/09 10:15)
    Now I want to calculate the value of cell A2 taking only time value only (10:15) from A1, using IF. How can I write syntax asking to look only the time value not date? If time = 10:15, A1=1.33, 1.65 Is it possible? I tried it gives me #Value! error. Appreciate your help.
    Thank you
    Jaz
    Last edited by jazbath; 06-10-2009 at 01:59 PM.

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

    Re: Time calculation

    To get the time only

    =MOD(A1,1)

  3. #3
    Forum Contributor
    Join Date
    12-08-2005
    Location
    Silicon Valley, CA USA
    Posts
    194

    Re: Time calculation

    Thank you DonkeyOte, it gives me time value but I like to add 1.3 time value to this for A2.
    Jaz

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

    Re: Time calculation

    Jaz, I'm afraid I'm struggling to understand your wants... could you provide a few examples ?

  5. #5
    Forum Contributor
    Join Date
    12-08-2005
    Location
    Silicon Valley, CA USA
    Posts
    194

    Re: Time calculation

    DonkeyOte,
    I am attaching an example sheet, hope this would explain better.
    Thank you for your time.
    Jaz
    Attached Files Attached Files

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

    Re: Time calculation

    Can you clarify as to what the 1.3 etc represents ? is 1.3 meant to be 1 and a 1/3 day - ie 30 hours or 1 and 1/3 hours ie 80 minutes ?

    Also not clear if you want to add 1.3 to the datetime value in A1 or just the Time ? Assuming you mean to add 1.3 days to A1 if the time in A1 is 16:30 then:

    A2: =A1+IF(MOD(A1,1)=0+"16:30",1.33,1.65)
    Last edited by DonkeyOte; 06-10-2009 at 02:44 AM.

  7. #7
    Forum Contributor
    Join Date
    12-08-2005
    Location
    Silicon Valley, CA USA
    Posts
    194

    Re: Time calculation

    Hi DonkeyOte,
    1.3 is the time value which is equal to about 32 hrs. Actually it is 1.3 days.
    I am adding time to that value in A1. That works perfectly, all it does is add add 1.3 days to A1 date/time value and put in A2 changing both date and time accordingly.
    thank you
    Jaz
    Last edited by jazbath; 06-10-2009 at 01:59 PM.

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

    Re: Time calculation

    The formula provided should then do what you want (adjust the 1.33 to 1.3 etc as required)

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