I am looking for assistance with excel function to find the minutes converted to days, hours, minutes in the attached. In Column A I have the values and result in column B. Can this be populated with the help of excel function in Column C?
I am looking for assistance with excel function to find the minutes converted to days, hours, minutes in the attached. In Column A I have the values and result in column B. Can this be populated with the help of excel function in Column C?
Last edited by vijanand1279; 06-12-2020 at 05:53 AM.
perhaps
=TEXT(A2/(24*60*60),"dd \d\a\y\s h \h\o\u\r\s m \m\i\n\u\t\e\s")
reduce to days and as above
Administrative Note:
We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.
Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).
Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.
(Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
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. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
The "Time" data are in seconds, I guess?
Przemyslaw Kowalik, Lublin Univ. of Technology
...that's really neat Dave. I like it. Not seen that technique before.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
I can't remember where I saw it, it does get a bit messy tho and arguably an if statement for each term could be needed so the text can be excluded. Such as the top line still returning minutes
A nice trick, but the result I see in Excel 2019 is:
03 days h hours 1 minutes
03 days h hours 1 minutes
03 days h hours 1 minutes
01 days h hours 1 minutes
Whereas vijanand1279 didn't specify them explicitly, the format requirements seems to be
1) no leading zeroes;
2) no output for zero values;
3) the singular form of the time unit if the correspoding value is 1.
Can it be done just by using cell formating features?
Administrative Note:
Sorry chaps, but your posts do not comply with Rule #6 of our Forum RULES:
Please do not ignore requests by Administrators, Moderators and senior forum members regarding forum rules.
If you are unclear about the request or instruction, then send a private message to them asking for clarification.
All Participants:
Please do not post a reply in a thread where a Moderator or Administrator has requested an action that has not yet been complied with (e.g. title change, code tags requested, etc.). Thanks.
it can but we can not offer help till the title changes
I am looking for assistance with excel function to find the minutes converted to days, hours, minutes in the attached. In Column A I have the values and result in column B. Can this be populated with the help of excel function in Column C?
Title fine now.
@vijanand1279, "minutes converted" - are you sure? The input data seem to be seconds, not minutes.
I agree its seconds if the above format is not what you desire a formula is much longer in b2
=IF(A2/60/60/24>=1,INT(A2/60/60/24),"")&IF(A2/60/60/24>=2," days ",IF(A2/60/60/24>=1," day ",""))&IF(MOD(A2/60/60,24)>=1,INT(MOD(A2/60/60,24)),"")&IF(MOD(A2/60/60,24)>=2," hours ",IF(A2/60/60/24>=1," hour ",""))&IF(MOD(A2/60,60)>=1,INT(MOD(A2/60,60)),"")&IF(MOD(A2/60,60)>=2," minutes",IF(MOD(A2/60,60)>=1," minutes",""))
Yes, it must that long or similar. The only simplifications I can see at the moment are replacing /60/60/24 with /86400 and /60/60 with /3600 but the difference in length is practically invsible.
Edit: a little bit shorter version
=IF(INT(A2/86400),INT(A2/86400)&" day"&IF(A2/86400>=2,"s "," "),"")&IF(INT(MOD(A2/3600,24)),INT(MOD(A2/3600,24))&" hour"&IF(MOD(A2/3600,24)>=2, "s "," "),"")&IF(INT(MOD(A2/60,60)),INT(MOD(A2/60,60))&" minute"&IF(MOD(A2/60,60)>=2,"s",""),"")
Last edited by PKowalik; 06-12-2020 at 12:01 PM.
Are you open to alternative outputs, or are you required to use the specified text string output? Here's how I would probably do it:
1) Use the CONVERT() function or equivalent to convert from seconds to days -> CONVERT(A2,"sec","day"). This will give a decimal day output that, for my purposes, is almost always enough.
2) If desired, use Excel's built in sexegesimal number format to show the value as days:hours:minutes with a number format code of dd:hh:mm. Remember that the underlying value is still the fraction of a day number that the CONVERT() function returns. Usually I find this advantageous for downstream calculations that want to use this number. The text string that your example shows is nearly useless for downstream calculations.
3) If you really like the display in the sample, you can enclose appropriate text in " " in a number format code (https://support.microsoft.com/en-us/...rs=en-us&ad=us ). Something like d" days "h" hours "m" minutes" will show something similar to your text string, but retain the underlying decimal days value.
I don't know that it is any simpler than other suggestions, but I would tend to prefer a number format where possible so that the numeric value of the underlying value is retained.
Originally Posted by shg
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks