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...

11-Jan-03162.63
12-Jan-03151.60
13-Jan-03140.43
14-Jan-03129.08
15-Jan-03117.48
16-Jan-03105.60
17-Jan-0393.39
18-Jan-0380.81
19-Jan-0367.83
20-Jan-0354.46
21-Jan-0340.74
22-Jan-0326.79
23-Jan-0312.72
24-Jan-031.31
25-Jan-0315.16
26-Jan-0328.70
27-Jan-0341.83
28-Jan-03305.46
29-Jan-03293.21
30-Jan-03281.36
31-Jan-03269.87
01-Feb-03258.65
02-Feb-03247.65
03-Feb-03236.78
04-Feb-03225.98
05-Feb-03215.17
06-Feb-03204.30
07-Feb-03193.35
08-Feb-03182.25
09-Feb-03170.98
10-Feb-03159.53
11-Feb-03147.88
12-Feb-03136.00
13-Feb-03123.89
14-Feb-03111.53
15-Feb-0398.92
16-Feb-0386.05
17-Feb-0372.92
18-Feb-0359.57
19-Feb-0346.04
20-Feb-0332.39
21-Feb-0318.72
22-Feb-035.15
23-Feb-038.22
24-Feb-0321.31
25-Feb-03325.96
26-Feb-03313.62
27-Feb-03301.67
28-Feb-03290.08
01-Mar-03278.81
02-Mar-03267.76
03-Mar-03256.87

<tbody>
</tbody>
<strike></strike>
Many thanks in advance!!

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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 ...

A​
B​
C​
D​
13​
22-Jan-03​
26.79​
0​
14​
23-Jan-03​
12.72​
0​
15​
24-Jan-03​
1.31​
1​
C15: =--(B15=MIN(B14:B16))
16​
25-Jan-03​
15.16​
0​
17​
26-Jan-03​
28.70​
0​

... 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:
20-Jan-2554.46FALSE
21-Jan-2540.74FALSE
22-Jan-2526.79FALSE
23-Jan-2512.72TRUE
24-Jan-251.31FALSE
25-Jan-2515.16FALSE
26-Jan-2528.7FALSE
27-Jan-2541.83FALSE
28-Jan-25305.46FALSE

<colgroup><col><col span="2"></colgroup><tbody>
</tbody>

Not sure why it missed by one day...

<colgroup><col><col><col></colgroup><tbody>
</tbody>



<colgroup><col><col></colgroup><tbody>
</tbody>

<colgroup><col><col span="2"></colgroup><tbody>
</tbody>
 
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,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

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