+ Reply to Thread
Results 1 to 12 of 12

Excel function for hh:mm

  1. #1
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Excel function for hh:mm

    Dear all

    Please see attached excel sheet. On Colum G (highlighted in green) there are hours and minutes. Is there a way I can create a function or macro so that it will convert the values to minutes. For example if the value 1:48 it will convert it 108 minutes or 0:36 will be 36 minutes.

    I know I can use =Hour() or =MINUTES() formula but this is long way. My sheet has over 10k data.

    kind regards
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Excel function for hh:mm

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy down

    PS. of course you can write
    Please Login or Register  to view this content.
    but then you don't see why it works

    other concept:
    write in empty cell 1440
    Ctrl+C
    select all your green column,
    Show Paste special dialog
    check Multiple
    Paste
    (dont unselect) Format all cells in green column (still selected) as General
    Last edited by Kaper; 05-23-2014 at 06:05 AM.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Excel function for hh:mm

    Thank you Kaper, it worked perfectly. you are a star

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Excel function for hh:mm

    In L2 Cell

    =VALUE(TEXT(G2,"[m]"))

    Drag it down...


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Excel function for hh:mm

    Also is there a way getting a total at the bottom which will say so many hours and so many minutes. Say it is 1104 minutes when we convert that hours and minutes it should say 18 hours and 40 minutes.

  6. #6
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Excel function for hh:mm

    I realised if there is -minus entry , it doesn't convert. for example -1:48 converts as #VALUE!, is there way to get round it?

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Excel function for hh:mm

    so once you have number of minutes in a range?
    try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Excel function for hh:mm

    Quote Originally Posted by lapot View Post
    for example -1:48 converts as #VALUE!
    =VALUE(TEXT(SUBSTITUTE(G2,"-",""),"[m]"))

  9. #9
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Excel function for hh:mm

    as for -
    then it is probably cell with text not time (in excel perspective).

    try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Excel function for hh:mm

    Quote Originally Posted by Kaper View Post
    as for -
    then it is probably cell with text not time (in excel perspective).

    try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    this has worked perfectly

  11. #11
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Excel function for hh:mm

    Quote Originally Posted by Kaper View Post
    so once you have number of minutes in a range?
    try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    this has worked perfectly

    many thanks

  12. #12
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Excel function for hh:mm

    Quote Originally Posted by lapot View Post
    this has worked perfectly
    many thanks

+ 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. Replies: 4
    Last Post: 04-24-2014, 11:56 AM
  2. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  3. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  4. Replies: 2
    Last Post: 03-30-2009, 04:04 AM
  5. Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04: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