Get smallest number is a sequence of data

TOKYOJ1

New Member
Joined
Aug 14, 2017
Messages
30
Hi,

I need some help to get Excel to extract all the smallest numbers [RED] in a repeating data sequence that goes from maximum to mininum and back to maximum...

[TABLE="width: 88"]
<tbody>[TR]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD][TABLE="width: 141"]
<tbody>[TR]
[TD]11-Jan-03[/TD]
[TD]162.63[/TD]
[/TR]
[TR]
[TD]12-Jan-03[/TD]
[TD]151.60[/TD]
[/TR]
[TR]
[TD]13-Jan-03[/TD]
[TD]140.43[/TD]
[/TR]
[TR]
[TD]14-Jan-03[/TD]
[TD]129.08[/TD]
[/TR]
[TR]
[TD]15-Jan-03[/TD]
[TD]117.48[/TD]
[/TR]
[TR]
[TD]16-Jan-03[/TD]
[TD]105.60[/TD]
[/TR]
[TR]
[TD]17-Jan-03[/TD]
[TD]93.39[/TD]
[/TR]
[TR]
[TD]18-Jan-03[/TD]
[TD]80.81[/TD]
[/TR]
[TR]
[TD]19-Jan-03[/TD]
[TD]67.83[/TD]
[/TR]
[TR]
[TD]20-Jan-03[/TD]
[TD]54.46[/TD]
[/TR]
[TR]
[TD]21-Jan-03[/TD]
[TD]40.74[/TD]
[/TR]
[TR]
[TD]22-Jan-03[/TD]
[TD]26.79[/TD]
[/TR]
[TR]
[TD]23-Jan-03[/TD]
[TD]12.72[/TD]
[/TR]
[TR]
[TD]24-Jan-03[/TD]
[TD]1.31[/TD]
[/TR]
[TR]
[TD]25-Jan-03[/TD]
[TD]15.16[/TD]
[/TR]
[TR]
[TD]26-Jan-03[/TD]
[TD]28.70[/TD]
[/TR]
[TR]
[TD]27-Jan-03[/TD]
[TD]41.83[/TD]
[/TR]
[TR]
[TD]28-Jan-03[/TD]
[TD]305.46[/TD]
[/TR]
[TR]
[TD]29-Jan-03[/TD]
[TD]293.21[/TD]
[/TR]
[TR]
[TD]30-Jan-03[/TD]
[TD]281.36[/TD]
[/TR]
[TR]
[TD]31-Jan-03[/TD]
[TD]269.87[/TD]
[/TR]
[TR]
[TD]01-Feb-03[/TD]
[TD]258.65[/TD]
[/TR]
[TR]
[TD]02-Feb-03[/TD]
[TD]247.65[/TD]
[/TR]
[TR]
[TD]03-Feb-03[/TD]
[TD]236.78[/TD]
[/TR]
[TR]
[TD]04-Feb-03[/TD]
[TD]225.98[/TD]
[/TR]
[TR]
[TD]05-Feb-03[/TD]
[TD]215.17[/TD]
[/TR]
[TR]
[TD]06-Feb-03[/TD]
[TD]204.30[/TD]
[/TR]
[TR]
[TD]07-Feb-03[/TD]
[TD]193.35[/TD]
[/TR]
[TR]
[TD]08-Feb-03[/TD]
[TD]182.25[/TD]
[/TR]
[TR]
[TD]09-Feb-03[/TD]
[TD]170.98[/TD]
[/TR]
[TR]
[TD]10-Feb-03[/TD]
[TD]159.53[/TD]
[/TR]
[TR]
[TD]11-Feb-03[/TD]
[TD]147.88[/TD]
[/TR]
[TR]
[TD]12-Feb-03[/TD]
[TD]136.00[/TD]
[/TR]
[TR]
[TD]13-Feb-03[/TD]
[TD]123.89[/TD]
[/TR]
[TR]
[TD]14-Feb-03[/TD]
[TD]111.53[/TD]
[/TR]
[TR]
[TD]15-Feb-03[/TD]
[TD]98.92[/TD]
[/TR]
[TR]
[TD]16-Feb-03[/TD]
[TD]86.05[/TD]
[/TR]
[TR]
[TD]17-Feb-03[/TD]
[TD]72.92[/TD]
[/TR]
[TR]
[TD]18-Feb-03[/TD]
[TD]59.57[/TD]
[/TR]
[TR]
[TD]19-Feb-03[/TD]
[TD]46.04[/TD]
[/TR]
[TR]
[TD]20-Feb-03[/TD]
[TD]32.39[/TD]
[/TR]
[TR]
[TD]21-Feb-03[/TD]
[TD]18.72[/TD]
[/TR]
[TR]
[TD]22-Feb-03[/TD]
[TD]5.15[/TD]
[/TR]
[TR]
[TD]23-Feb-03[/TD]
[TD]8.22[/TD]
[/TR]
[TR]
[TD]24-Feb-03[/TD]
[TD]21.31[/TD]
[/TR]
[TR]
[TD]25-Feb-03[/TD]
[TD]325.96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
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
What does "
sequence that goes from maximum to mininum and back to maximum" mean? Would you do the explanation with respect to 1.31 and 5.15?
 
Upvote 0
Maybe just ...

[Table="width:, class:grid"][tr][td="bgcolor:#C0C0C0"][/td][td="bgcolor:#C0C0C0"]
A​
[/td][td="bgcolor:#C0C0C0"]
B​
[/td][td="bgcolor:#C0C0C0"]
C​
[/td][td="bgcolor:#C0C0C0"]
D​
[/td][/tr][tr][td="bgcolor:#C0C0C0"]
13​
[/td][td]
22-Jan-03​
[/td][td]
26.79​
[/td][td]
0​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
14​
[/td][td]
23-Jan-03​
[/td][td]
12.72​
[/td][td]
0​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
15​
[/td][td]
24-Jan-03​
[/td][td]
1.31​
[/td][td]
1​
[/td][td]C15: =--(B15=MIN(B14:B16))[/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
16​
[/td][td]
25-Jan-03​
[/td][td]
15.16​
[/td][td]
0​
[/td][td][/td][/tr]
[tr][td="bgcolor:#C0C0C0"]
17​
[/td][td]
26-Jan-03​
[/td][td]
28.70​
[/td][td]
0​
[/td][td][/td][/tr]
[/table]


... which you could use as a CF formula.
 
Upvote 0
What does "
sequence that goes from maximum to mininum and back to maximum" mean? Would you do the explanation with respect to 1.31 and 5.15?

Hi,

The data is actually in degrees of rotation (360). It goes from 360 to 0 to 360 to 0 to 360.... (max to min to max to min...)
I just want to capture all the minimum angles before it goes back up again in long sequence of data.
 
Upvote 0
If you put =AND((SIGN((B1-B2)*(B2-B3))<0),(B2 < B1)) in B2 and drag down, it will return TRUE when B2 is a minimum relative to B1 and B3.
 
Last edited:
Upvote 0
It is not clear what exactly you are looking for for a solution... here is a macro that will do what I think you want.
Code:
[table="width: 500"]
[tr]
	[td]Sub HighlightMinimumValues()
  Dim R As Long, Data As Variant
  Data = Range("B1", Cells(Rows.Count, "B").End(xlUp))
  Columns("B").Cells.Font.ColorIndex = vbBlack
  For R = 2 To UBound(Data) - 1
    If Data(R, 1) < Data(R - 1, 1) And Data(R, 1) < Data(R + 1, 1) Then
    Cells(R, "B").Font.Color = vbRed
    End If
  Next
End Sub[/td]
[/tr]
[/table]
 
Upvote 0
If you put =AND((SIGN((B1-B2)*(B2-B3))<0),(B2 < B1)) in B2 and drag down, it will return TRUE when B2 is a minimum relative to B1 and B3.

Still testing this formula:
[TABLE="width: 228"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD]20-Jan-25[/TD]
[TD="align: right"]54.46[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]21-Jan-25[/TD]
[TD="align: right"]40.74[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]22-Jan-25[/TD]
[TD="align: right"]26.79[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]23-Jan-25[/TD]
[TD="align: right"]12.72[/TD]
[TD="align: center"]TRUE[/TD]
[/TR]
[TR]
[TD]24-Jan-25[/TD]
[TD="align: right"]1.31[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]25-Jan-25[/TD]
[TD="align: right"]15.16[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]26-Jan-25[/TD]
[TD="align: right"]28.7[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]27-Jan-25[/TD]
[TD="align: right"]41.83[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD]28-Jan-25[/TD]
[TD="align: right"]305.46[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 302"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Not sure why it missed by one day...[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 152"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 228"]
<colgroup><col><col span="2"></colgroup><tbody>[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I got it. Formula should be in C2 instead of C1.
You should have said you were looking for a formula solution in your original message. Here is another formula you can consider (place it in cell C2 and copy down)...

=AND(B3<=B2,B3<=B4)

Note: If you decide to stay with Mike's formula, you might want to change both of his "less than" signs to "less than or equal" signs so that it will mark multiple adjacent exact minimum values as TRUE instead of FALSE. My formula above already handles this situation.
 
Last edited:
Upvote 0
You should have said you were looking for a formula solution in your original message. Here is another formula you can consider (place it in cell C2 and copy down)...

=AND(B3<=B2,B3<=B4)

Note: If you decide to stay with Mike's formula, you might want to change both of his "less than" signs to "less than or equal" signs so that it will mark multiple adjacent exact minimum values as TRUE instead of FALSE. My formula above already handles this situation.


Eloquent solution. My sincere thanks!
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,208
Members
452,618
Latest member
Tam84

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