You can use formula to detect transitions from 1 to 0 and from 0 to 1. Just be careful around blank cells!
Consider following example (see screenshot below):
column B contains binary data pattern.
C2 will contain following formula:
=IF(AND(NOT(ISBLANK(B3)),B2=1,B3=0),1,0)
D2 will contain:
=IF(AND(NOT(ISBLANK(B3)),B2=0,B3=1),1,0)
You will just need to autofill formula for as many rows as you need in columns C and D.
- Amount of 1 (ones) in columnt C will represent amount of transitions from 1 to 0.
- Amount of 1 (ones) in columnt D will represent amount of transitions from 0 to 1.
And in the end you need is to sum ones (1) in columnds C and D
In example below:
D18=SUM(C2:C16)
D19=SUM(D2:D16)
Can you give us an example of your data? – CLockeWork – 2014-12-02T16:45:27.770