Folks, would really appreciate some help;
If I have the following values of data in Excel (3 examples below) where data is coded as 1 or 2, does anyone know an Excel formula which can count how many 'switches' occur in the sequence of values? What I mean by a 'switch', is when the 1's switch to 2's, and vice versa (when the 2's switch to 1's).
For example;
1, 1, 1, 1, 1, 1, 1, 2, 2 (there is 1 switch here)
1, 2, 2, 1, 1, 1, 1, 1, 1 (there are two switches here)
1, 2, 2, 1, 1, 1, 1, 2, 2 (there are three switches here)
So far, I am able to use the following formula (see below) to see IF there is a switch at all in the sequence (from 2 to 1 for example). But now I am trying to calculate how many switches are occurring in the sequence, and not IF a singular switch is occurring. So I think I possibly need to use a COUNT formula, instead of a FIND formula?
=IF(ISERROR(FIND("21",TEXTJOIN("",TRUE,[data range of a row]))),FALSE,TRUE)
Any help is appreciated.
