Intergers and Remainders

I am trying to format a number (with in numbers) this is formatted as Integer value AND Modulo (sp?) of its decimal remained as x fractional unit.


Example might be: 21 3 (sevenths) NOT 2 3/7; an acceptable form could even be 2w 3d. The number in my spreadsheet represents weeks and days. Mentally interpreted as 2 weeks and 3 days per each new leaf. I know it may seem strange, but the fraction in this case would probably confuse my readers to some extent. The numeric form in thuis case for me is important.

Posted on Sep 23, 2020 6:45 PM

Reply
6 replies

Sep 25, 2020 7:58 AM in response to Badunit

Thank you for pointing me to this feature.


While I've located the Duration settings menu, and have tried to assign the setting (which would be really ideal). The setting is not holding on the cell. Instead it persists to revert to a format of a 'number'. Even with-in a preview of the number; before I tab off the cell it shows a decimal based number.

Sep 25, 2020 8:13 AM in response to MstrPBK

If you have the decimal number 17 representing the number of days and you want to express that in weeks and days then you have to convert from Number to Duration first, using the DURATION function. Then you can apply the custom Duration formatting you want.



=DURATION(0,A2)


You need to leave that leading 0 or the weeks placeholder in there.


Or if you want a more verbose presentation (or need to export to Excel) then you can use the first method I suggested above, without first converting to Duration, something like this:




Substitute ; for , in the formulas if your regions uses , as a decimal separator.


SG

Sep 25, 2020 8:20 AM in response to MstrPBK

If whatever is in the cell already can't be turned into the format you are trying to select, it won't hold. If I type 17 into a cell then change the format to duration, it turns it into 2 weeks 3 days but if I have the formula =B2+1 in the cell, where B2 is a number, it is a numeric formula that will not convert to a duration.


So, if you have formulas in those cells, you may have to rework the formulas into duration formulas or do as SGIII says and use the DURATION function to convert them.

Sep 25, 2020 8:40 AM in response to MstrPBK

Depending on what you are doing you may find it easier to work with the decimal numbers and convert to Duration at the end.


But if you want to rework your calculations to express everything in Duration and you're have trouble getting a 17 (or whatever) that you've entered to convert to Duration (the formatting doesn't "stick") then keep in mind that you can unambiguously tell Numbers you mean Duration by using special input notation. If you haven't pre-formatted the cell (as say, Text) then just enter 17d and Numbers will treat that immediately as Duration. w, h, m, s, and ms are also valid notation for entering Duration.


SG



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Intergers and Remainders

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.