Mac Numbers: Formulas and Functions help

Hi,


There is a function called QUOTIENT, under Numeric functions, which returns integer quotient of two numbers. The fractional part is ignored in the result.


For ex, QUOTIENT(5, 6) returns 0, because 5 divided by 6 is 0.833333333333333 and the fractional part is ignored.


Which function can I use to get the result including the fractional part?


Thank you.

MacBook Pro, OS X El Capitan (10.11.5)

Posted on Apr 23, 2017 11:51 AM

Reply
6 replies

Apr 23, 2017 2:31 PM in response to rbrails1

You should check the Data Format of the cell.

# '/' is represented as '÷' in the formula editor.

User uploaded file

Select the Paint brush icon, select [Cell] tab.

'Data format' should be either Automatic or Number, and 'Decimal' should not be 0. Use Auto to automatically adjust the digits for fractional part, or set to the specific number you wish to see in fractional part.

# For example, setting '2' for 'Decimals' for the cell shown above gives "0.20"

User uploaded file

Apr 23, 2017 1:45 PM in response to rbrails1

rbrails1 wrote:

Which function can I use to get the result including the fractional part?

QUOTIENT(x, y) returns the integer part of x/y.

So,

  1. if you want the integer part and fractional part together, just do x/y
  2. if you want the fractional part only, you need, x/y - QUOTIENT(x,y) , or MOD(x/y,sign(x/y))

# sign(x/y) can be any of,

  • sign(x*y)
  • sign(x)/sign(y)
  • sign(x)*sign(y)

Apr 24, 2017 11:30 AM in response to rbrails1

Setting the precision to 0 places after the decimal affects only the display.

The actual result stored in the cell in your example is 0.200000000000000; the displayed value is that value rounded to the number of decimal places you have chosen.


If further calculations are done using that result, it is the actual value, not the displayed value, that is used.


Regards,

Barry

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.

Mac Numbers: Formulas and Functions help

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