Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a Match in Multiple Places & Return Multiple Values Toria Excel Worksheet Functions 3 June 24th 08 09:49 PM
find multiple results Larry Banach Excel Discussion (Misc queries) 9 November 24th 06 07:15 PM
Repeated Multiple Find rcmodelr Excel Programming 3 October 16th 05 07:09 AM
INTRICATE PROBLEM- How to find multiple text,excluding "H", in a multiple range of cells, then replacing 0 with another number in another cell Tourcat Excel Worksheet Functions 1 February 8th 05 06:26 PM
find across multiple sheets me1 Excel Programming 1 April 12th 04 01:44 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"