+ Reply to Thread
Results 1 to 4 of 4

Convert shorthand time text strings into full sentences

  1. #1
    Registered User
    Join Date
    10-13-2015
    Location
    mumbai
    MS-Off Ver
    MS Office 2007
    Posts
    2

    Convert shorthand time text strings into full sentences

    Hello All,

    I want to convert below values in following format "xx days xx hours xx minutes"

    -2d 10h
    -27min
    -2h 29m
    -1w 1d
    -1w 1d
    -2d 12h
    -2d 8h
    -1d 18h
    0min
    0min
    1min
    -1w 2d
    -3h 59m

    Can anyone please provide me the formula.
    Last edited by AliGW; 10-16-2018 at 09:11 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,828

    Re: Can anyone help me to provide excel formula

    Welcome to the forum!

    This forum requires you to give more informative thread titles. By way of an example, I have changed yours for you this time. Please bear this advice in mind in future. Thanks!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-13-2015
    Location
    mumbai
    MS-Off Ver
    MS Office 2007
    Posts
    2

    Re: Convert shorthand time text strings into full sentences

    thank you for giving proper heading

  4. #4
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Convert shorthand time text strings into full sentences

    Hi,

    Not sure what the Dash " - " at the beginning of the data means (does it mean negative?, or it doesn't mean anything?)
    Assuming the Dash means nothing, here's one way:

    Excel 2016 (Windows) 64 bit
    A
    B
    1
    -2d 10h 2 day(s) 10 hour(s)
    2
    -27min 27 minute(s)
    3
    -2h 29m 2 hour(s) 29 minute(s)
    4
    -1w 1d 1 week(s) 1 day(s)
    5
    -1w 1d 1 week(s) 1 day(s)
    6
    -2d 12h 2 day(s) 12 hour(s)
    7
    -2d 8h 2 day(s) 8 hour(s)
    8
    -1d 18h 1 day(s) 18 hour(s)
    9
    0min 0 minute(s)
    10
    0min 0 minute(s)
    11
    1min 1 minute(s)
    12
    -1w 2d 1 week(s) 2 day(s)
    13
    -3h 59m 3 hour(s) 59 minute(s)
    Sheet: Sheet104

    Excel 2016 (Windows) 64 bit
    B
    1
    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"-",""),"w"," week(s)"),"d"," day(s)"),"h"," hour(s)"),"min","m"),"m"," minute(s)")
    Sheet: Sheet104

    Formula copied down.

+ 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: 3
    Last Post: 01-11-2018, 04:41 AM
  2. [SOLVED] Can someone please help adding arguments to a formula or provide a better solution?
    By mshaneweaver in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-07-2014, 05:51 PM
  3. Apply an excel formula to provide sum of desired months
    By PRADEEPB270 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2013, 10:22 AM
  4. Needed urgent help from a excel master to provide and explain a formula
    By amitav in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2012, 04:21 AM
  5. [SOLVED] Provide formula for autofilter
    By Solomon14all in forum Excel General
    Replies: 2
    Last Post: 09-26-2012, 07:27 AM
  6. provide:Need formula help
    By Paul in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-04-2006, 07:45 PM
  7. To return value that provide data to a formula
    By flaminang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-29-2005, 05:54 AM

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