+ Reply to Thread
Results 1 to 6 of 6

get time and date difference based on the hour or minutes given

  1. #1
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    get time and date difference based on the hour or minutes given

    hi there,

    any body knows how to get the date and time difference if the given data say is:

    given current time is:10-05-2013 10:38 AM

    then user enters like: 10 ( means 10 hours)

    the difference would be: 10-05-2013 12:39 AM (this is easy to get , however if the user enters in minutes like 45 which is in minutes then i don't get the accurate time and date)

    can any one help on this? thanks in advance

  2. #2
    Registered User
    Join Date
    09-06-2013
    Location
    Winterville, NC, USA
    MS-Off Ver
    Excel 2013
    Posts
    23

    Re: get time and date difference based on the hour or minutes given

    can you submit a sample spreadsheet with existing formulas?

  3. #3
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: get time and date difference based on the hour or minutes given

    hi there!

    here are the formulas:

    given current time:
    Please Login or Register  to view this content.
    (this is placed in C3)

    to get the difference:
    Please Login or Register  to view this content.
    (this is placed in C7)

    user enters on C5 (like 10, which means 10 hours)

  4. #4
    Registered User
    Join Date
    07-17-2013
    Location
    Calooan, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: get time and date difference based on the hour or minutes given

    If the user enter 45 minutes, you want the hours to decrease? Is that what you want?

  5. #5
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: get time and date difference based on the hour or minutes given

    Quote Originally Posted by danjim02 View Post
    If the user enter 45 minutes, you want the hours to decrease? Is that what you want?
    yes, basically if the user enters like 10 (which means 10 hours) then this should be subtracted from the current date and time...however if the user enters like 45 minutes...this comes the challenge i am having...i know i sound confusing but can you give me an idea how can this be done? like how can I get the date and time difference if the user enters hours or minutes

  6. #6
    Registered User
    Join Date
    07-17-2013
    Location
    Calooan, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: get time and date difference based on the hour or minutes given

    You can use a function like DateDiff. However, I still didn't use it and don't know if it is gonna work.
    As far as I know, DateDiff returns a number of date intervals.

    Experimental code: (Might help)
    Please Login or Register  to view this content.
    Try to play more with DateDiff.
    Last edited by danjim02; 10-05-2013 at 03:13 PM.

+ 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. Return difference in days, hours, minutes between two date and time ranges.
    By craig amolsch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2013, 06:21 PM
  2. [SOLVED] Count hour/minutes that meet conditions and within an date/time interval
    By DirkBekkers in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2013, 10:36 AM
  3. [SOLVED] Subtract date/time from data/time and get difference in minutes
    By zit1343 in forum Excel General
    Replies: 2
    Last Post: 06-18-2012, 11:23 AM
  4. Automated Counter + 24 hour Time Difference.
    By all4excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-27-2008, 02:15 PM
  5. Calculate time difference to the half hour
    By Ken Ivins in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 03:05 PM

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