Finding highest values above a threshold

DoctorData

New Member
Joined
Jan 29, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
mode calcs.xlsx
ABCDEFG
2Size (mm)Amount (%)Peak abovePeak aboveThreshold A (above base)2
3Threshold A?Threshold B?Threshold B (above adjacent troughs)2
4630.00
54514.224545
631.54.99FALSEFALSEFirst peak (above Threshold A)45
722.41.24FALSEFALSESecond highest peak (above Threshold A)11.2
81613.20FALSEFALSEThird highest peak (above Threshold A)4
911.213.8011.2FALSE
10813.51FALSEFALSEFirst peak (above Threshold B)45
115.613.31FALSEFALSESecond highest peak (above Threshold B)4
12415.8944Third highest peak (above Threshold B)#NUM!
132.812.12FALSEFALSE
1426.69FALSEFALSE
151.43.30FALSEFALSE
1611.03
Sheet1
Cell Formulas
RangeFormula
C5:C15C5=IF(AND(B5>=B4,B5>B6,B5>=G$2),A5)
D5:D15D5=IF(AND(B5>=B4,B5>B6,B5>=G$2,(B5-B6)>G$3,(B5-B4)>G$3),A5)
G6G6=LARGE(C5:C15,1)
G7G7=LARGE(C5:C15,2)
G8G8=LARGE(C5:C15,3)
G10G10=LARGE(D5:D15,1)
G11G11=LARGE(D5:D15,2)
G12G12=LARGE(D5:D15,3)


1643552841484.png



I have sets of data where I want to find peaks (or 'modes'). These are actually amounts of stones in different sizes. The spreadsheet simply finds values where the values either side are lower. But I have two situations where I don't want peaks to be identified:

(1) Threshold A where peaks are not large. In the spreadsheet I have set an additional condition where the peak must be larger than 2% (but in this example all three peaks are larger than 2%)

(2) Threshold B where peaks are larger than adjacent troughs but a set amount. In the example I have set this to 2%. HOWEVER in the spreadsheet it only finds troughs one row above or below each value. I need to be able to identify a trough any distance above or below. In the example of Peak 2 the troughs are 2 rows up and 2 rows down. Is there a way to use INDEX and MATCH to search up and down from each point?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,164
Messages
6,170,447
Members
452,327
Latest member
kris9926

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top