Refer next value in array in excel formula

How about just offsetting the arrays:

=INDEX(I22:M22<>0,)<>INDEX(J22:N22<>0,)

This finds where a value is <>0 but the one after it =0, or vice versa

<edit: and enter with Ctrl+Shift+Enter />