compare subtraction in following numbers

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
510
Office Version
  1. 365
Platform
  1. Windows
hello!
is there a better formula for checking ALL subtractions between two following/neighboring
(e2:d2 and h2:g2 and so on)
numbers if they are identical?

cause i want to modify the wanted formula for checking all kinds of rangers and it's tedious the way i wrote it
for example: i want to check if the subtraction of every two cells, i2-h2 and h2-g2 and etc are the same BUT without the subtraction of e2-d2
so i need a more flexible formula to adujst

test
CDEFGHIJ
11234567identical subtractions
224681012141
315225598991000
4101520253035401
test
Cell Formulas
RangeFormula
J2:J4J2=IF(AND(I2-H2=H2-G2,H2-G2=G2-F2,G2-F2=F2-E2,F2-E2=E2-D2,E2-D2=D2-C2),1,0)
 
6StringJazzer - sincerely... i'm agreeing with you, i'm doing my best to explain (eng isn't my native lang)

Eric W - thank you for joining in and trying to help!
column L is great!!
and M even greater!

thanks a bunch!!!!

you offered/asked:
"Notice that on the last row, there were 3 differences of 2, and 3 differences of 5, but only 5 showed up. Do you want both to show up somehow?"
i'll mostly working with 6 cells (and sometimes 4) so the number of diff's will be uneven, so there will not be a problem of equal diff's, but if there's way to show both MCD i'll gladly accept your offer!
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
stand corrected, even with 6 cells (or 4) there's can be even diff's
like in 1-3-5-8-11-15 there's diff's of 2 of 2's and 2 of 3's and 1 of 4
 
Upvote 0
Try this:

Book1
CDEFGHIJKL
1123456# of MCDMost common differenceMCD 2 (if more than 1)
22468101252 
315225598991417
410152025303555 
52469101232 
624611162135 
713581115223
Sheet8
Cell Formulas
RangeFormula
J2:J7J2=SUMPRODUCT(--(D2:H2-C2:G2=K2))
K2:K7K2=MODE((D2:H2-C2:G2)*{1;1})
L2:L7L2=IFERROR(INDEX(MODE.MULT((D2:H2-C2:G2)*{1;1}),2),"")
Press CTRL+SHIFT+ENTER to enter array formulas.


I moved the columns to make it a bit easier. Your example is on row 7. Also look at row 3. It only shows 4 and 17, but since every difference is different (4,17,33,43,1) it only shows the first 2. You can just copy the formula to the right and change the index from 2 to 3 or more to get the rest. There's a way to show all of them with one formula, but it's probably not worth explaining. Hope this helps!
 
Upvote 0
perfect!
just one little thing, when there's 3 diff's and then 2's, the formula in col L don't give the second diff
see row 7

test
CDEFGHIJKL
1123456# of MCDMost common differenceMCD 2 (if more than 1)
22468101252 
315225598991417
410152025303555 
52469101232 
624611162135 
71357111532 
test
Cell Formulas
RangeFormula
J2:J7J2=SUMPRODUCT(--(D2:H2-C2:G2=K2))
K2:K7K2=MODE((D2:H2-C2:G2)*{1;1})
L2:L7L2=IFERROR(INDEX(MODE.MULT((D2:H2-C2:G2)*{1;1}),2),"")
 
Upvote 0
The formula only shows the differences that are the most frequent, or are tied for the most frequent. If you want 2 or more of the differences sorted by frequency, that's much tougher. I could do it with the newer Excel functions, but it's a challenge with the 2013 functions.
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,646
Members
449,462
Latest member
Chislobog

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