shorten 2 divide formulas

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
510
Office Version
  1. 365
Platform
  1. Windows
hi, how can i shorten this into one? but by counting the true ones (sum?)
Cell Formulas
RangeFormula
I2I2=MOD(H2,G2)=0
J2J2=MOD(H2,F2)=0
K2K2=MOD(H2,E2)=0
L2L2=MOD(H2,D2)=0
M2M2=MOD(H2,C2)=0
N2N2=MOD(G2,F2)=0
O2O2=MOD(G2,E2)=0
P2P2=MOD(G2,D2)=0
Q2Q2=MOD(G2,C2)=0
R2R2=MOD(F2,E2)=0
S2S2=MOD(F2,D2)=0
T2T2=MOD(F2,C2)=0
U2U2=MOD(E2,D2)=0
V2V2=MOD(E2,C2)=0
W2W2=MOD(D2,C2)=0


same thing to this one?
Cell Formulas
RangeFormula
I2I2=MOD(C1,C2)=0
J2J2=MOD(C1,D2)=0
K2K2=MOD(C1,E2)=0
L2L2=MOD(C1,F2)=0
M2M2=MOD(C1,G2)=0
N2N2=MOD(C1,H2)=0
O2O2=MOD(D1,C2)=0
P2P2=MOD(D1,D2)=0
Q2Q2=MOD(D1,E2)=0
R2R2=MOD(D1,F2)=0
S2S2=MOD(D1,G2)=0
T2T2=MOD(D1,H2)=0
U2U2=MOD(E1,C2)=0
V2V2=MOD(E1,D2)=0
W2W2=MOD(E1,E2)=0
X2X2=MOD(E1,F2)=0
Y2Y2=MOD(E1,G2)=0
Z2Z2=MOD(E1,H2)=0
AA2AA2=MOD(F1,C2)=0
AB2AB2=MOD(F1,D2)=0
AC2AC2=MOD(F1,E2)=0
AD2AD2=MOD(F1,F2)=0
AE2AE2=MOD(F1,G2)=0
AF2AF2=MOD(F1,H2)=0
AG2AG2=MOD(G1,C2)=0
AH2AH2=MOD(G1,D2)=0
AI2AI2=MOD(G1,E2)=0
AJ2AJ2=MOD(G1,F2)=0
AK2AK2=MOD(G1,G2)=0
AL2AL2=MOD(G1,H2)=0
AM2AM2=MOD(H1,C2)=0
AN2AN2=MOD(H1,D2)=0
AO2AO2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BT3BT3=MOD(H2,F3)=0
BU3BU3=MOD(H2,G3)=0
BV3BV3=MOD(H2,H3)=0
BX3BX3=MOD(C3,D2)=0
BY3BY3=MOD(C3,E2)=0
BZ3BZ3=MOD(C3,F2)=0
CA3CA3=MOD(C3,G2)=0
CB3CB3=MOD(C3,H2)=0
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
had a mistake in the second sample, here's a fix
test.xlsb
CDEFGH
2123456
3789101112
test

Cell Formulas
RangeFormula
Z3Z3=MOD(C2,D2)=0
AA3AA3=MOD(C2,E2)=0
AB3AB3=MOD(C2,F2)=0
AC3AC3=MOD(C2,G2)=0
AD3AD3=MOD(C2,H2)=0
AE3AE3=MOD(C2,C3)=0
AF3AF3=MOD(C2,D3)=0
AG3AG3=MOD(C2,E3)=0
AH3AH3=MOD(C2,F3)=0
AI3AI3=MOD(C2,G3)=0
AJ3AJ3=MOD(C2,H3)=0
AK3AK3=MOD(D2,C2)=0
AL3AL3=MOD(D2,E2)=0
AM3AM3=MOD(D2,F2)=0
AN3AN3=MOD(D2,G2)=0
AO3AO3=MOD(D2,H2)=0
AP3AP3=MOD(D2,C3)=0
AQ3AQ3=MOD(D2,D3)=0
AR3AR3=MOD(D2,E3)=0
AS3AS3=MOD(D2,F3)=0
AT3AT3=MOD(D2,G3)=0
AU3AU3=MOD(D2,H3)=0
AV3AV3=MOD(E2,C2)=0
AW3AW3=MOD(E2,D2)=0
AX3AX3=MOD(E2,F2)=0
AY3AY3=MOD(E2,G2)=0
AZ3AZ3=MOD(E2,H2)=0
BA3BA3=MOD(E2,C3)=0
BB3BB3=MOD(E2,D3)=0
BC3BC3=MOD(E2,E3)=0
BD3BD3=MOD(E2,F3)=0
BE3BE3=MOD(E2,G3)=0
BF3BF3=MOD(E2,H3)=0
BG3BG3=MOD(F2,C2)=0
BH3BH3=MOD(F2,D2)=0
BI3BI3=MOD(F2,E2)=0
BJ3BJ3=MOD(F2,G2)=0
BK3BK3=MOD(F2,H2)=0
BL3BL3=MOD(F2,C3)=0
BM3BM3=MOD(F2,D3)=0
BN3BN3=MOD(F2,E3)=0
BO3BO3=MOD(F2,F3)=0
BP3BP3=MOD(F2,G3)=0
BQ3BQ3=MOD(F2,H3)=0
BR3BR3=MOD(G2,C2)=0
BS3BS3=MOD(G2,D2)=0
BT3BT3=MOD(G2,E2)=0
BU3BU3=MOD(G2,F2)=0
BV3BV3=MOD(G2,H2)=0
BW3BW3=MOD(G2,C3)=0
BX3BX3=MOD(G2,D3)=0
BY3BY3=MOD(G2,E3)=0
BZ3BZ3=MOD(G2,F3)=0
CA3CA3=MOD(G2,G3)=0
CB3CB3=MOD(G2,H3)=0
CC3CC3=MOD(H2,C2)=0
CD3CD3=MOD(H2,D2)=0
CE3CE3=MOD(H2,E2)=0
CF3CF3=MOD(H2,F2)=0
CG3CG3=MOD(H2,G2)=0
CH3CH3=MOD(H2,C3)=0
CI3CI3=MOD(H2,D3)=0
CJ3CJ3=MOD(H2,E3)=0
CK3CK3=MOD(H2,F3)=0
CL3CL3=MOD(H2,G3)=0
CM3CM3=MOD(H2,H3)=0
CN3CN3=MOD(C3,C2)=0
CO3CO3=MOD(C3,D2)=0
CP3CP3=MOD(C3,E2)=0
CQ3CQ3=MOD(C3,F2)=0
CR3CR3=MOD(C3,G2)=0
CS3CS3=MOD(C3,H2)=0
 
Upvote 0
If your values in columns C to H are increasing (i.e., C2 less than or equal to D2, D2 less than or equal to E2, ..., G2 less than or equal to H2) the formula in column Y below should work. As you can see in the examples in rows 7 and 8 where the values are not in increasing order, the formula does not return the same value as the count of the trues in Columns I to W.

Cell Formulas
RangeFormula
I2:I4,I7:I8I2=MOD(H2,G2)=0
J2:J4,J7:J8J2=MOD(H2,F2)=0
K2:K4,K7:K8K2=MOD(H2,E2)=0
L2:L4,L7:L8L2=MOD(H2,D2)=0
M2:M4,M7:M8M2=MOD(H2,C2)=0
N2:N4,N7:N8N2=MOD(G2,F2)=0
O2:O4,O7:O8O2=MOD(G2,E2)=0
P2:P4,P7:P8P2=MOD(G2,D2)=0
Q2:Q4,Q7:Q8Q2=MOD(G2,C2)=0
R2:R4,R7:R8R2=MOD(F2,E2)=0
S2:S4,S7:S8S2=MOD(F2,D2)=0
T2:T4,T7:T8T2=MOD(F2,C2)=0
U2:U4,U7:U8U2=MOD(E2,D2)=0
V2:V4,V7:V8V2=MOD(E2,C2)=0
W2:W4,W7:W8W2=MOD(D2,C2)=0
X2:X4,X7:X8X2=COUNTIF(I2:W2,TRUE)
Y2:Y4,Y7:Y8Y2=LET(a,SORT(C2:H2,,-1),ta, TRANSPOSE(a), b, SUM(--((MOD(a,ta)=0) )), ca, COLUMNS(a), b - (SUM(--(a=ta )) - ca)/2 - ca )
Z2:Z4,Z7:Z8Z2=IF(Y2=X2,"MATCH", "ERROR")
 
Upvote 0
You're doing a Matrix operation and have 365, why not just do:
Book1
ABCDEFG
1123456
21000000
32101010
43120120
54123012
65123401
76123450
Sheet1
Cell Formulas
RangeFormula
B1:G1B1=SEQUENCE(,6)
A2:A7A2=SEQUENCE(6)
B2:G7B2=MOD(B1#,A2#)
Dynamic array formulas.

It's not quite what you're looking for, but maybe someone has an idea of how to use some of the newer functions like BYROW to get it all into a single cell formula in the format you want.

I wasn't thinking and fought it until I realized you started at C2! But thanks for using XL2BB - does help!
 
Upvote 0
my apologies for not explaining right,
i want to know how many numbers in c2:h2 divides each other without a remainder,
and same for sample #2 which is c2:h3,
so what i have above is the long way, and i wonder if there's instead one formula to replace it all



test.xlsb
CDEFGH
2123456
3489101112
test


for c2:h2 - 6 divide with 2, and 3 and 4 divide with 2 and etc
for c2:h3 - 12 divide with 6 and 2 and 3 and 4, 8 divide with 4 and 2 and etc
just to know how many...
 
Last edited:
Upvote 0
my apologies for not explaining right,
i want to know how many numbers in c2:h2 divides each other without a remainder,
and same for sample #2 which is c2:h3,
so what i have above is the long way, and i wonder if there's instead one formula to replace it all



test.xlsb
CDEFGH
2123456
3489101112
test


for c2:h2 - 6 divide with 2, and 3 and 4 divide with 2 and etc
for c2:h3 - 12 divide with 6 and 2 and 3 and 4, 8 divide with 4 and 2 and etc
just to know how many...
Just a slight adaptation to get that answer:
Book1
ABCDEFGH
11234560 Remainder:
21TRUETRUETRUETRUETRUETRUE6
32FALSETRUEFALSETRUEFALSETRUE3
43FALSEFALSETRUEFALSEFALSETRUE2
54FALSEFALSEFALSETRUEFALSEFALSE1
65FALSEFALSEFALSEFALSETRUEFALSE1
76FALSEFALSEFALSEFALSEFALSETRUE1
80 Remainder: 12232414
9Row Check: 14
Sheet1
Cell Formulas
RangeFormula
B1:G1B1=SEQUENCE(,6)
A2:A7A2=SEQUENCE(6)
B2:G7B2=MOD(B1#,A2#)=0
B8:G8B8=COUNTIFS(B2:B7,TRUE)
H2:H7H2=COUNTIFS(B2:G2,TRUE)
H8H8=SUM(H2:H7)
H9H9=SUM(B8:G8)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:G7Cell Value=FALSEtextNO
B2:G7Cell Value=TRUEtextNO

Just hide or group the rows you don't want/need!
 
Upvote 0
What is the expected result?
A guess

T202212a.xlsm
CDEFGH
2123456
3
48
1f
Cell Formulas
RangeFormula
C4C4=SUM(--(MOD(H2,C2:G2)=0),--(MOD(G2,C2:F2)=0),--(MOD(F2,C2:E2)=0),--(MOD(E2,C2:D2)=0),--(MOD(D2,C2)=0))
 
Upvote 0
What are the expected results
T202212a.xlsm
ABCDEFGH
1
28123456
32389101112
4
1f
Cell Formulas
RangeFormula
B2:B3B2=SUM(--(MOD(H2,C2:G2)=0),--(MOD(G2,C2:F2)=0),--(MOD(F2,C2:E2)=0),--(MOD(E2,C2:D2)=0),--(MOD(D2,C2)=0))
 
Upvote 0
Another option for the 1st part
Cell Formulas
RangeFormula
I2:I4,I7:I8I2=MOD(H2,G2)=0
J2:J4,J7:J8J2=MOD(H2,F2)=0
K2:K4,K7:K8K2=MOD(H2,E2)=0
L2:L4,L7:L8L2=MOD(H2,D2)=0
M2:M4,M7:M8M2=MOD(H2,C2)=0
N2:N4,N7:N8N2=MOD(G2,F2)=0
O2:O4,O7:O8O2=MOD(G2,E2)=0
P2:P4,P7:P8P2=MOD(G2,D2)=0
Q2:Q4,Q7:Q8Q2=MOD(G2,C2)=0
R2:R4,R7:R8R2=MOD(F2,E2)=0
S2:S4,S7:S8S2=MOD(F2,D2)=0
T2:T4,T7:T8T2=MOD(F2,C2)=0
U2:U4,U7:U8U2=MOD(E2,D2)=0
V2:V4,V7:V8V2=MOD(E2,C2)=0
W2:W4,W7:W8W2=MOD(D2,C2)=0
B2:B4,B7:B8B2=SUM(MAKEARRAY(1,5,LAMBDA(r,c,SUM(--(MOD(INDEX(C2:H2,,c+1),DROP(C2:H2,,c-6))=0)))))
 
Upvote 0
jdellasala - thank you but i need to apply it on thousands of rows

dave and fluff - both of you nailed it! - thanks a lot!

anyone can help with the two rows? c2:h3 ?
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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