Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default stuck on division


A) 25/5=5
B) 28/5=5.6

I pick up a value and want to test if it is divisible by 5. If the result
is not a whole number I need to hold off what ever the count might be, so in
case B I would store in some variable 3 from the 28 allowing the calculation
to result in 5. I am at a loss as how to test if the result is a whole
number and if not how to figure out what to reduce the numerator by.

Appreciatively,
Arturo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default stuck on division

Hi Arturo,

If you're looking for a VBA solution, look at the Mod operator:

Debug.Print 25 Mod 5
Debug.Print 28 Mod 5

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Arturo wrote:
A) 25/5=5
B) 28/5=5.6

I pick up a value and want to test if it is divisible by 5. If the
result is not a whole number I need to hold off what ever the count
might be, so in case B I would store in some variable 3 from the 28
allowing the calculation to result in 5. I am at a loss as how to
test if the result is a whole number and if not how to figure out
what to reduce the numerator by.

Appreciatively,
Arturo

  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default stuck on division

There is also a MOD() function for use in a sheet...
-----Original Message-----
Hi Arturo,

If you're looking for a VBA solution, look at the Mod

operator:

Debug.Print 25 Mod 5
Debug.Print 28 Mod 5

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address

unmonitored]


Arturo wrote:
A) 25/5=5
B) 28/5=5.6

I pick up a value and want to test if it is divisible

by 5. If the
result is not a whole number I need to hold off what

ever the count
might be, so in case B I would store in some variable 3

from the 28
allowing the calculation to result in 5. I am at a

loss as how to
test if the result is a whole number and if not how to

figure out
what to reduce the numerator by.

Appreciatively,
Arturo

.

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
Division EK Excel Worksheet Functions 2 May 3rd 07 04:05 PM
Need help with division, please!!! swag143 Excel Worksheet Functions 1 August 16th 06 05:01 PM
Division David New Users to Excel 5 July 26th 06 11:06 AM
Division help? clayblay Excel Discussion (Misc queries) 6 January 13th 06 02:51 PM
Division help? clayblay Excel Discussion (Misc queries) 0 January 12th 06 11:54 PM


All times are GMT +1. The time now is 06:11 PM.

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"