Days between peaks

cloobless

Board Regular
Joined
Jul 15, 2014
Messages
84
Office Version
  1. 2010
Platform
  1. Windows
Hi, I'm seeking a solution for conditionally counting the days between max values.

In the example below, I'm trying to construct a conditional formula for the "DaysUnderPeak" column. This column would output the text "new peak" if the "Peak"(B) value is higher than the previous Date's(A) peak value. If the new peak is the start of a sequence of days where the peak value is unchanged, the output would numerically increment until a new peak is measured.

Note that the first peak in any sequence is always the text "new peak", not "1".

I colored and outlined the data below to help explain what I'm trying to do. Any help or suggestions would be most welcomed. Thank you very much for taking a look.


nUpZ2yP.jpg
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
put this in E3 and drag down as needed.
Code:
=IF(B3=B2,IF(E2="New Peak",2,E2 + 1),"New Peak")
 
Last edited:
Upvote 0
Holy moly, that is neat. Thank you so much, JLGWhiz. l think I was a long way from doing it correctly. Thank you for taking the time to help me out. I appreciate it.
 
Upvote 0
Holy moly, that is neat. Thank you so much, JLGWhiz. l think I was a long way from doing it correctly. Thank you for taking the time to help me out. I appreciate it.
No problem, glad you could use it.
Regards, JLG
 
Upvote 0
Before asking for more help I gave this shot for most of the morning. I failed and I'm back. I hoping someone or JLG might see this.

Is there a way to identify the low value in each sequence of "days under" data in something like the L column faked below? The formulas I returned don't seem to be checking the whole sequence, or identify the wrong value, or neither. Thank you to anyone who might see this.

a8sgFYR.jpg
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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