I'm creating a workbook which pulls in data from user-specifed data files and performs some processing on it.
As far as possible, I'd like to do the bulk of the processing via dynamic named ranges. This should be faster and much neater.
I'm having a little trouble with one of the processes I want to perform. Imagine I have two ranges, x and y - both of which are 1 cell wide and N rows tall. I have also specified a threshold "Thresh". I define another range, ThreshX as:
=If(y>Thresh, x).
If I now enter =COUNT(ThreshX) in a cell I get the number of cells in ThreshX - i.e. the number of cells in which y>Thresh.
That works fine, no problem. However, I also want to count the number of peaks in x, i.e. the number of contiguous regions in ThreshX. To do so, I entered into a cell the formula:
=AREAS(ThreshX). Unfortunately, this returns the Value! error.
I have found a way round the problem, but it is slightly messy. Does anyone have any idea why the Areas method does not work, and if there is any change I could apply to the syntax I'm using which would make it work the way you'd expect?
Tony
As far as possible, I'd like to do the bulk of the processing via dynamic named ranges. This should be faster and much neater.
I'm having a little trouble with one of the processes I want to perform. Imagine I have two ranges, x and y - both of which are 1 cell wide and N rows tall. I have also specified a threshold "Thresh". I define another range, ThreshX as:
=If(y>Thresh, x).
If I now enter =COUNT(ThreshX) in a cell I get the number of cells in ThreshX - i.e. the number of cells in which y>Thresh.
That works fine, no problem. However, I also want to count the number of peaks in x, i.e. the number of contiguous regions in ThreshX. To do so, I entered into a cell the formula:
=AREAS(ThreshX). Unfortunately, this returns the Value! error.
I have found a way round the problem, but it is slightly messy. Does anyone have any idea why the Areas method does not work, and if there is any change I could apply to the syntax I'm using which would make it work the way you'd expect?
Tony