Hello Everyone,
I'm new to excel formulas so I may not be doing this the most efficient way, any advice is much appreciated!
So I have one column filled with numeric data, Lets say its in column A with values filled from A1 to A200. This data will have peaks and troughs, and I can count the number of peaks the data has with the following formula:
=SUMPRODUCT(--(A2:A199>A1:A198),--(A2:A199>A3:A200))
Here this formula requires me to know the 1st, 2nd and 3rd cell address from the top of my column (easy, as it always starts in the same location). It also needs the 1st, 2nd and 3rd cell address from the bottom of my column (HARD! As my data list is often very long, and its time consuming)
I have 2 problems:
1) How to find the cell address of the last filled cell in the column automatically.
I have tried =CELL("ADDRESS",INDEX(A:A,ROWS(A:A),COLUMNS(A:A))), but this gives me the address of the last cell value possible in excel ($A$1048576)
I have also tried to find the last value in a column with =INDEX(A:A,COUNTA(A:A)), and then find the cell address for this value with =CELL("ADDRESS",INDEX((A:A),MATCH(D2,A:A,0))) but this doesn't work because if there are 2 or more values with this number it will retrieve the first cell address which has a match.
2) How can I (if this is possible?) then modify my peak formula to say something like =SUMPRODUCT(--(A2:(coordinate of last value-1)>A1:(coordinate of last value -2),--(A2:(coordinate of last value -1)>A3:A(coordinate of last value)))
Thank you for reading, I've been scratching my head over this for ages!
Bookmarks