We will be migrating from Ask to Discourse on the first week of August, read the details here

# Modulus Function (Remainder after division) [closed]

Hello.

I'm trying to figure out how to separate a whole number from the remainder.

For example, after and equation I get (3.14). I'd like the 3 in one column and the .14 to be saved in another so I can carry it to the next calculation.

Is this possible?

Thank you, -Chris

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2020-10-25 12:25:38.437642

1

Please note that numerical contents and results (numbers) may also be negative.
You will have to decide explicitly if you want -3.14 to be split into (-3|-0.14) or (-4|+0.86).
The suggestion by @librebel will return the second pair.

Sort by » oldest newest most voted Hello @codewolf,

Suppose that your value 3.14 is located in cell A1,

To get the integral part ( =3 ) just put the following formula into cell B1:

= INT( A1 )

To get the decimal part ( =0.14 ) put the following formula into cell C1:

=A1 - INT( A1 )

HTH, lib

more

2

IMO, the MOD is the proper solution, because it is not only solving the task, but also self-documenting and telling: =MOD(A1;SIGN(A1))

sorry, but this answer is wrong. As above comment says correctly: MOD() is the proper function here! Look at the functions MOD and ROUND or ROUNDDOWN

more

Also QUOTIENT:

=QUOTIENT(20;3)

gives 6

=MOD(20;3)

gives 2

1

In fact MOD(Dividend;Divisor) also accepts negative numbers and non-integers.
It is defined generally as
MOD(Dividend;Divisor) = Divisor - INT(Dividend/Divisor)*Divisor
where the INT(Dividend/Divisor) differs from QUOTIENT(Dividend;Divisor) if the two arguments have different signs.