is 3 a factor?

MikeL

Active Member
Joined
Mar 17, 2002
Messages
488
Office Version
  1. 365
Platform
  1. Windows
Hi, I am using XL 2000.

I have a value in cell A1. In cell B1, I am trying to write a formula to determine if "3" is a factor of the value in cell A1. What could that formula be?

I was thinking of: If(A1/3."yes","no"), but I cant seem to put the correct equation after the division.

Thanks in advance.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
the formula:
=MOD(A1,3)=0

will return TRUE if the value in cell A1 is evenly divided by 3, otherwise FALSE

hth
kevin
 
Upvote 0
I just noticed that the MOD formula only works if the number in A1 is a whole number. See my second set of samples below for a formula that works on decimals also.
New Book.xls
ABCD
13yes=IF(MOD(A1,3)=0,"yes","no")
23.33no
34no
46yes
5
63yes=IF(GCD(A6,3)=3,"yes","no")
73.33yes
84no
96yes
Sheet1
 
Upvote 0
What is the GCD? Is that a new function? It is not in Office 97. What does it do?

thanks. . .texasalynn
 
Upvote 0
I don't think GCD is part of an add-in, like MoreFunc. I'm using Excel 2000 and I believe it's part of the standard Math/Trig functions.

But I just found the GCD doesn't work in all situations. For example, on 6.664, it returns a "yes", which is incorrect, since 3 doesn't go into 6.664 evenly. Still working on it.
 
Upvote 0
per HELP

Returns the greatest common divisor of two or more integers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.
If this function is not available, run the Setup program to install the Analysis ToolPak. After you install the Analysis ToolPak, you must enable it by using the Add-Ins command on the Tools menu.

f any value is not an integer, it is truncated.
 
Upvote 0
I just had to click to turn on the Analysis Pack in the add-ins. Now I have GCD as a function.

Thanks . . . texasalynn
 
Upvote 0
Dave Patton said:
per HELP

Returns the greatest common divisor of two or more integers. The greatest common divisor is the largest integer that divides both number1 and number2 without a remainder.

If any value is not an integer, it is truncated.

That is because in mathematics "mod" (from number theory - and so too, GCD) only deals with integers. So while in simple division, 3 divides "evenly" (w/o a remainder) into 6.6666, in number theory it is a non issue, so to speak.
 
Upvote 0

Forum statistics

Threads
1,221,695
Messages
6,161,361
Members
451,699
Latest member
sfairbro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top