How to compare intervals?

11

I think it's not hard to do this, but I could not do it even though I tried to wonder if anyone could help me.

In an Excel worksheet I have random numbers from A1 to A6 and would like to compare the sequences of the first two cells "A1: A2" with "A2: A3", then "A3: A4", and so on ... the same thing for "A2: A3" with "A3: A4", and then with all other "double cells."

If the values and the order of the "cell doubles" are the same I would like to return "true" by saying what the equal intervals are.

I made this description to make it easier, and the only restriction in column A is between A1 and A6.

    
asked by anonymous 21.09.2015 / 16:52

2 answers

8

I would do it this way.

Belowtheformulas:

First,Igiveanameforeachpair.

Then,Iconcatenatethenumbers(with-betweenthemnottomixandconfusethenumbers).

Then,Icopythenameofeachpairandtheconcatenatednumbersforacolumnandaline.

Finally,insidethetable,Icomparetheconcatenatedvalues.

Issue

Thereisnoneedfortheanswer,buttounderstandhowIdidthetable,ifyouwanttoreplicate.Anditcanbeausefulconcept.

TocopytherangeasIdid,forcolumnsEandFofthecomparisontable:

  • SelectfromE4toF9;

  • Typeequal(=);

  • SelectfromB3toC8;

  • Presscontrol+Shift+Enter.ThisinsertsanarrayincellsE4throughF9

ForthevaluesfromG2toL3: -SelectfromG2toL3;

  • Type"=transpor(" (without quotation marks);

  • Select from B3 to C8;

  • Type ")" (without quotation marks) to close the formula transpor ;

  • Press control + Shift + Enter. This inserts an array in cells G2 to L3, with the transposed (rotated) values of B3 to C8.

22.09.2015 / 03:40
4

Using your specifications the "manual" way of doing what you want is:

D1 X D2 =$A$1=A2    =$A$2=A3
D1 X D3 =$A$1=A3    =$A$2=A4
D1 X D4 =$A$1=A4    =$A$2=A5
D1 X D5 =$A$1=A5    =$A$2=A6

D2 X D3 =$A$2=A3    =$A$3=A4
D2 X D4 =$A$2=A4    =$A$3=A5
D2 X D5 =$A$2=A5    =$A$3=A6

D3 X D4 =$A$3=A4    =$A$4=A5
D3 X D5 =$A$3=A5    =$A$4=A6

D4 X D5 =$A$4=A5    =$A$5=A6

Note that each line will compare the first element of Dx with the first element of Dy and the second element of Dx with the second element of Dy (where x and y are numbers 1 to 6 and y> p>

Each formula will give a FALSE or TRUE return. If necessary, you can use the E( ) formula to compare the results of the first and second elements to get a single boolean to know if both ranges are equal.

Another way to do this would be to create a function in VBA.

    
21.09.2015 / 23:20