ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to find multiple of a value? (https://www.excelbanter.com/excel-programming/374119-how-find-multiple-value.html)

crapit[_2_]

How to find multiple of a value?
 
How do I use formula to check whether the decimal value is a mutiple of
0.25?

E.g 5.25, 18.50, 1.75 decimal value are multiple of 0.25




Otto Moehrbach

How to find multiple of a value?
 
If the decimal value is a multiple of 0.25, then the remainder of dividing
the decimal value by 0.25 is zero. This formula does just that and returns
"Yes" if it is a divisor, otherwise "No".
=IF(MOD(A1,0.25)=0,"Yes","No")

HTH Otto

"crapit" wrote in message
...
How do I use formula to check whether the decimal value is a mutiple of
0.25?

E.g 5.25, 18.50, 1.75 decimal value are multiple of 0.25






semiopen

How to find multiple of a value?
 

crapit wrote:
How do I use formula to check whether the decimal value is a mutiple of
0.25?

E.g 5.25, 18.50, 1.75 decimal value are multiple of 0.25


Function IsMultiple(num As Double) As Boolean
IsMultiple = (Round(10000 * num) Mod 2500 = 0)
End Function

This will give some false positves (e.g. 14.75001). What it really does
is to check if a number, rounded to 4 decimal places, is a multiple of
0.25. Because of the possibility of round-off errors, you can't avoid
this sort of thing completely. Add more zeros for more accuracy.

-semiopen


DriverDB

How to find multiple of a value?
 
Just for fun, because I haven't thought it through...

=IF(A1*4=INT(A1*4),"Yes","No")

"crapit" wrote in
:

How do I use formula to check whether the decimal value is a mutiple of
0.25?

E.g 5.25, 18.50, 1.75 decimal value are multiple of 0.25






All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com