+ Reply to Thread
Results 1 to 3 of 3

convert a time duration to a number to use in a formula

  1. #1
    Registered User
    Join Date
    01-12-2010
    Location
    Salt Lake City
    MS-Off Ver
    Excel 2007
    Posts
    29

    convert a time duration to a number to use in a formula

    My issue is this, I have calculated a time duration using two different time periods and have for example 2 hours. I want to multiply this by a dollar amount for example $20. When I perform the calculation the resulting amount is not correctly calculated. I calculated a time from 1:00 pm to 3:00 pm and this resulted in 2 hours. the columns are formatted as "time" format. I then multiply this by $20 and my result is $1.67. If I change the answer to a date format it calculates to 4:00:00 pm. which is not what I am looking for.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: convert a time duration to a number to use in a formula

    =(hour(B1)-hour(A1))*20
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: convert a time duration to a number to use in a formula

    Hi there,

    If you're dealing with times which have hour and minute values you could use:

    Please Login or Register  to view this content.
    where the starting time is in Cell A1 and the finishing time is in Cell B1.


    Regards,

    Greg M



    P. S. Although a cell containing a time value of one hour may be formatted to display 01:00, it actually contains a numerical value of 1/24
    Last edited by Greg M; 02-25-2020 at 07:28 PM. Reason: P. S. Added

+ 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. Convert Excel text to time duration
    By KrazyKasper in forum Excel General
    Replies: 4
    Last Post: 06-08-2019, 01:15 PM
  2. Convert time to duration
    By Cbaffoni87 in forum Excel General
    Replies: 3
    Last Post: 02-15-2017, 06:11 AM
  3. Convert call time duration to seconds
    By anilaa88 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2013, 05:27 PM
  4. Converting duration or time into a number
    By awcwa in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-27-2013, 05:32 PM
  5. Convert Duration to Single Number
    By TJM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2010, 05:46 PM
  6. [SOLVED] How do I convert time (2:30) to a number (2.5) in a formula?
    By tammyj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-25-2005, 12: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