Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find a Match in Multiple Places & Return Multiple Values | Excel Worksheet Functions | |||
find multiple results | Excel Discussion (Misc queries) | |||
Repeated Multiple Find | Excel Programming | |||
INTRICATE PROBLEM- How to find multiple text,excluding "H", in a multiple range of cells, then replacing 0 with another number in another cell | Excel Worksheet Functions | |||
find across multiple sheets | Excel Programming |