Divided by two numbers

robertdseals

Active Member
Joined
May 14, 2008
Messages
334
Office Version
  1. 2010
Platform
  1. Windows
I have a number and I want to see if it is divided by 10 and/or 8. 16 would because it can be divided by 8. 36 would because 2 10's and 2 8's. 17 would not because although you could get a 10 out of it, you wouldn't have enough left for an 8. Any thoughts?
 
All this does is identify even numbers. The numbers 12, 14, 22, 32 should all fail but are TRUE from your formula.

I think the question worded very poorly* but I think what he really wants is clear. The number conforms if it can be calculated as 8x + 10y where x and y are non-negative integers.

@robertdseals you have not answered my question about the possible range of numbers. The simplest method is the lookup table that I already provided but I can provide a VBA solution if that is not adequate.

*None of these numbers can be divided by 8 or 10.
No, and I'm not sure how I can make it any more clear. I wanted to know if a number can be divided by both 10, 8, or a combination of the two with no remainder. 12 would NOT be able to fit into this category.
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
It sounds like you are looking for a TRUE result if the number can be divided by either 8 or 10 and FALSE otherwise. If that is the case...

=OR(MOD(A1,8)=0,MOD(A1,10)=0)
I don't know if this would solve for 26 (with one 10 and two 8's).
 
Upvote 0
This description does not indicate an actual result that can be shown in an Excel cell.

Are you looking for a Yes or No to indicate whether a given number can be created by summing only 10's and 8's?

If that is correct, this sounds like an iterative problem that can only be solved by Solver or VBA. I don't think this can be done with formulas. What kind of solution are you open to?

What is the range of possible numbers? It might actually be easier to generate all possible numbers that meet your criteria up to your limit.

Cell Formulas
RangeFormula
C2:L2C2=B2+1
B3:L13B3=B$2*10+$A3*8
A4:A13A4=A3+1
Interesting solution! This might work. Thanks,
 
Upvote 0
Your original description and your latest post, when taken together, are a little bit unclear to me. Let me ask this... what answer would you want for the numbers 18, 26, 28 and 34?
Yes, because 10 & 8, yes because 10 and two 8's, yes because two 10's and an 8, yes because 1 10 and three 8's.
 
Upvote 0
Does this work for you

T202205a.xlsm
AB
118TRUE
226TRUE
328TRUE
434TRUE
5
1b
Cell Formulas
RangeFormula
B1:B4B1=OR(--RIGHT(A1,1)={0,2,4,6,8})
No, because it would give me true answers for 2,4,6,12. Niether which are divided by 10 and/or 8 (34 would because there are 3 8's and 1 10). I hope that makes sence.
 
Upvote 0
All this does is identify even numbers. The numbers 12, 14, 22, 32 should all fail but are TRUE from your formula.

I think the question worded very poorly* but I think what he really wants is clear. The number conforms if it can be calculated as 8x + 10y where x and y are non-negative integers.

@robertdseals you have not answered my question about the possible range of numbers. The simplest method is the lookup table that I already provided but I can provide a VBA solution if that is not adequate.

*None of these numbers can be divided by 8 or 10.
EXACTLY! so, being divided by 8 and/or 10 would not leave any remainders.
 
Upvote 0
If you have 10 in B1, 8 in C1 and 16 (or 36) in A2
Then in B2, put the CSE formula {=MATCH(0,MOD(A2-{0,1,2,3,4,5,6,7,8,9,10}*$B$1,$C$1),0)-1)} , which returns the number of 10's needed for the sum
in C2, =(A2-B2*$B$1)/$C$1 will return the number of 8's needed.

If the number in A2 cannot be expressed as a linear combination of B1 and C1, then they will return #NA.
 
Upvote 0
Upvote 0
Or how 'bout this?
MrExcel_20220515.xlsx
ABCDE
1Value VDivisor XDivisor YaX+bY=Va,b int.
218108TRUE
326108TRUE
428108TRUE
534108TRUE
636108TRUE
717108FALSE
812108FALSE
914108FALSE
1022108FALSE
1132108TRUE
Sheet6
Cell Formulas
RangeFormula
D2:D11D2=OR(MOD(A2-SEQUENCE(FLOOR(A2/B2,1)+1,,0)*B2,C2)=0)
 
Upvote 0
The OP's profile shows 2010 so won't have the Sequence function. ;)
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,791
Members
449,188
Latest member
Hoffk036

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