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.
 
So, all that being taken into consideration, does anyone have any idea how to get 3.33 to return "yes" and 3.34 to return "no"? I've been beating my head against it for the past hour. :confused:
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Barry

You could make the number an integer

=GCD(A8*100,3)=3

with 3.33 this will give True; with 3.34 it will give False
 
Upvote 0
Barry Katcher said:
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.


How about this:
=IF(A1/3=INT(A1/3),"Yes","No")

Seems to work correctly
 
Upvote 0
Hey, Dave and Egress. Both of your formulas, with a little tweaking to bring the multiplier up to 1,000,000, seems to work for numbers with up to 6 decimal places. Nice going, guys, thanks. :LOL:
Book1
ABCD
1
2DaveEgress1
33yesyes
43.33yesyes
53.34nono
64nono
76yesyes
812.666666yesyes
99.999998nono
10
Sheet1
 
Upvote 0
Well, guys, upon further Beta-testing, I came up with another glitch. The multiplier takes care of the numbers with decimals, but screws up on the ones without, or with fewer places than the multiplier provides for. At this rate, this looks like it will end up going into Omega-testing. :(
Keepers1.xls
ABCDE
2Numbertotest
34
4
5Formulaby:
6DavePattonEgress1
73yesyes
83.33yesyes
93.34yesyes
104yesyes
116yesyes
1212.666666nono
139.999998nono
14
Sheet1
 
Upvote 0
Hi Barry:

In this formulation, the formula in column D automatically looks at if i the values in column A have to be multiplied with whatever power of 10 that it needs to multiply them with and proceeds from there ...
y030515h1.xls
ABCD
1
2DaveEgress1
33yesyesyes
43.33yesyesyes
53.34nonono
64nonono
76yesyesyes
812.666666yesyesyes
99.999998nonono
10
Sheet4
 
Upvote 0
oblique response:

you can turn the decimal portion of a number into a whole number with the following (amongst many others):

=RIGHT(MOD(A1,INT(A1)),LEN(MOD(A1,INT(A1)))-2)+0

paddy
 
Upvote 0
Barry either of these should work

=GCD(--(INT(A6)&RIGHT(MOD(A6,INT(A6)),LEN(MOD(A6,INT(A6)))-2)+0),3)=3

=GCD(A6*(LOOKUP(LEN(A6)-LEN(INT(A6))-1,{0,1,2,3,4,5,6;0,10,100,1000,10000,100000,1000000})),3)=3

-check the number of 0s

HTH Dave
 
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