+ Reply to Thread
Results 1 to 6 of 6

Convert Hours, day and week values in minutes

  1. #1
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Convert Hours, day and week values in minutes

    Hi All,

    I have to deal with outlook task dumps and get a history of work done over several years.

    For one year's worth, I have over 8000 tasks to process, and I was wondering if there was a macro I could use.

    Data being handled by the macro would be the Total Work done per task, which can be in the form of:

    15 minutes,
    1 hour,
    3 hours,
    1 day,
    2 days
    1 week
    5 weeks

    I would like a macro that could process it so that the 3 hours example would be something like this

    3 hours
    If hours multiply 3 by 60 = 180

    And if 15 minutes, remove the minutes to end up with 15

    Where can I get what I need/is there existing code/or can one of you excel gods help me?

    Thanks!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Convert Hours, day and week values in minutes

    Hi Jon,

    Can you attach a sample file with your list of possible numbers and words that might appear. This looks like a modified VLookup() table answer. They aren't that hard.

    To attach a sample file, click on "Go Advanced" and then the Paper Clip Icon above the advanced message box.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Re: Convert Hours, day and week values in minutes

    Book2.xlsx

    Here is the file

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Convert Hours, day and week values in minutes

    OK - see the formula of:

    =LEFT(A2,FIND(" ",A2))*VLOOKUP(TRIM(MID(A2,FIND(" ",A2),LEN(A2))),$D$1:$E$6,2,FALSE)

    in the attached. I created a table also to convert those words to numbers..
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Re: Convert Hours, day and week values in minutes

    that's quite nice, a coworker also showed me the text-to-columns function that works quite nice to separate number from text, and I just if functioned my way to victory.

    How could I get the text-to-columns and my if statement in a macro?

    Here is if statement

    =IF(LEFT(C6,3)="wee",B6*5*7.5*60,IF(LEFT(C6,3)="day",B6*7.5*60,IF(LEFT(C6,3)="hou",B6*60,IF(LEFT(C6,3)="min",B6,B6))))

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Convert Hours, day and week values in minutes

    You may also try this to see if this works as per the requirement.

    Option Explicit
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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 days hours minutes seconds to just minutes
    By hollylynn in forum Excel General
    Replies: 4
    Last Post: 08-28-2015, 08:53 AM
  2. Excel 2007 : Convert number of minutes to hours and minutes
    By MikeFromIndy in forum Excel General
    Replies: 30
    Last Post: 06-05-2015, 08:10 AM
  3. Convert Days:Hours:Minutes:seconds to minutes.
    By Kevingardner1 in forum Excel General
    Replies: 4
    Last Post: 06-03-2014, 06:44 PM
  4. Replies: 1
    Last Post: 08-08-2013, 09:21 AM
  5. [SOLVED] Function or macro to convert string with weeks, days, hours, minutes to Hours
    By kknb0800 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2012, 11:35 AM

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.6.0 RC 1