Identify Peaks and Troughs in a column in Excel sheet

mailsmithah

New Member
Joined
Feb 19, 2021
Messages
15
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am new to excel would like to know how to identify peaks and troughs in a column in excel sheet. Able to identify peaks and troughs if they are far apart but if continous values are peak or trough in a sequence it does not identify the peaks and troughs.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Have referred this post Peaks and Troughs

But it does not solve the issue
=IF(ISBLANK(Final!A3),"Y",IF(ISNUMBER(Final!$A2:Final!$A4),IF(OR(AND(NOT(ISBLANK(Final!A2)),NOT(ISBLANK(Final!A4)),ISNUMBER(Final!A2:Final!A4),Final!A3>Final!A2,Final!A3>Final!A4,Final!A3>Final!A5),AND(NOT(ISBLANK(Final!A2)),NOT(ISBLANK(Final!A4)),NOT(ISBLANK(Final!A5)),ISNUMBER(Final!A2:Final!A4),Final!A3<Final!A2,Final!A3>Final!A4,Final!A3<Final!A5),AND(NOT(ISBLANK(Final!A2)),NOT(ISBLANK(Final!A4)),ISNUMBER(Final!A2:Final!A4),Final!A3<Final!A2,Final!A3<Final!A1,Final!A3<Final!A4),AND(ISBLANK(Final!A2),NOT(ISBLANK(Final!A4)),ISNUMBER(Final!A2:Final!A4),Final!A3>Final!A2,Final!A3<Final!A4,Final!A3<Final!A1)),"Y","."),IF(OR(AND(Final!A3>Final!A2,Final!A3>Final!A4),AND(Final!A3<Final!A2,Final!A3<Final!A4)),IF(AND(Final!$A3=Final!$A2,Final!$A3=Final!$A4),IF(Final!A3=MAX((Final!$A$2:Final!$A$100000=Final!$A2),Final!A2:INDEX(Final!A2:Final!A100000,SUMPRODUCT(--EXACT(Final!$A3,Final!$A2:Final!$A$100000)))),".","Y"),"."),".")))

This is the formula i am using
 
Upvote 0
=IF(ISBLANK(Final!A3),"Y",IF(ISNUMBER(Final!$A2:Final!$A4),IF(OR(AND(NOT(ISBLANK(Final!A2)),NOT(ISBLANK(Final!A4)),ISNUMBER(Final!A2:Final!A4),Final!A3>Final!A2,Final!A3>Final!A4,Final!A3>Final!A5),AND(NOT(ISBLANK(Final!A2)),NOT(ISBLANK(Final!A4)),NOT(ISBLANK(Final!A5)),ISNUMBER(Final!A2:Final!A4),Final!A3<Final!A2,Final!A3>Final!A4,Final!A3<Final!A5),AND(NOT(ISBLANK(Final!A2)),NOT(ISBLANK(Final!A4)),ISNUMBER(Final!A2:Final!A4),Final!A3<Final!A2,Final!A3<Final!A1,Final!A3<Final!A4),AND(ISBLANK(Final!A2),NOT(ISBLANK(Final!A4)),ISNUMBER(Final!A2:Final!A4),Final!A3>Final!A2,Final!A3<Final!A4,Final!A3<Final!A1)),"Y","."),IF(OR(AND(Final!A3>Final!A2,Final!A3>Final!A4),AND(Final!A3<Final!A2,Final!A3<Final!A4)),IF(AND(Final!$A3=Final!$A2,Final!$A3=Final!$A4),IF(Final!A3=MAX((Final!$A$2:Final!$A$100000=Final!$A2),Final!A2:INDEX(Final!A2:Final!A100000,SUMPRODUCT(--EXACT(Final!$A3,Final!$A2:Final!$A$100000)))),".","Y"),"."),".")))

This is the formula i am using
This is the Excel data
 

Attachments

  • 4Rdtr.jpg
    4Rdtr.jpg
    217.8 KB · Views: 14
Upvote 0
I've got something, but it does require four work columns.

Column A: =your source data
Column B: =if(A2>A1,"grow",if(A2=A1,"steady","decline"))
Column C: =if(B2="steady",C1,B2)
Column D: =if(C2=C3,"",if(C2="grow","high","low"))
Column E: =if(b3="steady",D3,D2)
 
Upvote 0
I've got something, but it does require four work columns.

Column A: =your source data
Column B: =if(A2>A1,"grow",if(A2=A1,"steady","decline"))
Column C: =if(B2="steady",C1,B2)
Column D: =if(C2=C3,"",if(C2="grow","high","low"))
Column E: =if(b3="steady",D3,D2)
I am applying the formula in the second sheet in the same excel, so it shows "Y" for peaks and troughs and a "." If its a normal value.
 
Upvote 0
I am applying the formula in the second sheet in the same excel, so it shows "Y" for peaks and troughs and a "." If its a normal value.
The issue arises when there is continous peak or trough values like 4000,6000 and 8000 in the column A, it does not mark all these cells as "Y" in the second sheet.
 
Upvote 0
The issue arises when there is continous peak or trough values like 4000,6000 and 8000 in the column A, it does not mark all these cells as "Y" in the second sheet.
Would like to know if it all its achievable with Excel Formula because maximum 3 adjacent column values can be compared within an AND or OR,. After which the formula just grows in length.
 
Upvote 0
I've made one change to the formule in column E (highlighted red).
Otherwise it seems to work just fine for mw.

Column A: =your source data
Column B: =if(A2>A1,"grow",if(A2=A1,"steady","decline"))
Column C: =if(B2="steady",C1,B2)
Column D: =if(C2=C3,"",if(C2="grow","high","low"))
Column E: =if(b3="steady",E3,D2)
 
Upvote 0
I've made one change to the formule in column E (highlighted red).
Otherwise it seems to work just fine for mw.

Column A: =your source data
Column B: =if(A2>A1,"grow",if(A2=A1,"steady","decline"))
Column C: =if(B2="steady",C1,B2)
Column D: =if(C2=C3,"",if(C2="grow","high","low"))
Column E: =if(b3="steady",E3,D2)
Can't these be clubbed to a single formula applied to one cell, in second sheet... Will try that
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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