Greetings! I have a question that I believe it should be fairly easy to resolve for someone with experience. I have a data set that looks something like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Run[/TD]
[TD="align: center"]Order[/TD]
[TD="align: center"]Sequence[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]-[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
As you can see, the order always remains constant for each Run (1, 2, 3, 4), and the Runs always consist of 4 steps. What is variable is the sequence, which can take any of the following values: "-", "1", "2", "3", "4".
That being said, I need a formula that highlights the 4 "Run" cells in red when the sequence for that Run is any different from the two following sequences: "2 ,1, 3, 4" or "2, 1, 3, -":
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Run
[/TD]
[TD="align: center"]Order
[/TD]
[TD="align: center"]Sequence
[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]-[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
For instance, this would be an invalid Run since it doesn't follow any of the two admitted sequences "2 ,1, 3, 4" or "2, 1, 3, -".[TABLE="width: 500"]
<tbody>[TR]
[TD]Run[/TD]
[TD]Order[/TD]
[TD]Sequence[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
I appreciate any help you may provide. Thanks in advance,
Ale
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Run[/TD]
[TD="align: center"]Order[/TD]
[TD="align: center"]Sequence[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]-[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]SODA[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
As you can see, the order always remains constant for each Run (1, 2, 3, 4), and the Runs always consist of 4 steps. What is variable is the sequence, which can take any of the following values: "-", "1", "2", "3", "4".
That being said, I need a formula that highlights the 4 "Run" cells in red when the sequence for that Run is any different from the two following sequences: "2 ,1, 3, 4" or "2, 1, 3, -":
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Run
[/TD]
[TD="align: center"]Order
[/TD]
[TD="align: center"]Sequence
[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]CAR[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]APPLE[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]-[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
For instance, this would be an invalid Run since it doesn't follow any of the two admitted sequences "2 ,1, 3, 4" or "2, 1, 3, -".[TABLE="width: 500"]
<tbody>[TR]
[TD]Run[/TD]
[TD]Order[/TD]
[TD]Sequence[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]3[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]SODA
[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
I appreciate any help you may provide. Thanks in advance,
Ale