Hi there,

I've not really done any excel programming before, but I'm not aware of any functions that would allow me to achieve the following:

I have data for the presence of fish (1 - present, 'blank' not present) at discreet time intervals (the columns), with each fish in the observation having its own separate row. Please see attached simplified example.fish_residency_data.jpg

'1's in a contiguous line (i.e. without a blank space separating them) are treated as a single 'residency period', so in the example Fish 1 & 2 have a single residency period (fish 2 being there for less time than fish 1), and Fish 3 has two residency periods. I need to extract residency data from this table i.e. for each fish, how many residency periods and how long is each period (how many '1's in a contiguous line).

Does anyone have a recommendation for how best to tackle this problem in excel please? Happy to provide more info if required.

Many thanks,

James