Excel help

Soldato
Joined
1 Oct 2004
Posts
10,772
Location
Cambs/Herts
I have a large table of data that looks like this:

helprk.png


The "is a peak" and "is a trough" columns have been programmed to check if the value in the "P/dBm" is a local maximum or minimum. So in the case of the final row, the value is a peak because it is greater than the six above it and the six below it.

In the "modulation index" column I need to examine the "is a peak" element of that row, and if the value is a peak calculate a value based on that row's "P/dBm" value and the next peak's "P/dBm".

In short: how can I scan the "is a peak" column, detect the TRUE elements, and where there is a TRUE element perform some function depending on the next TRUE element down?

Sorry if that's difficult to understand...:(
 
Last edited:
Can you move the Is a Peak column to the left of the data? (If not then a slightly more difficult formula using match and offset/index).

Assuming Is a Peak is column A
P/dBm is column c
Last data row is 200

in row 2:
=vlookup(True,A3:A$200,3,false)
Will return the value from the third column in the range from the next row with True in the first column.
So you want something like:
=if(A2=True,=vlookup(True,A3:A$200,3,false),"") to give you the next peak P/dBm value

Just copy the formula down your table
 
Back
Top Bottom