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>
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
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?
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,718
Office Version
2010
Platform
Windows
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.
 

TOKYOJ1

New Member
Joined
Aug 14, 2017
Messages
30
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.
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
22,802
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:

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,508
Office Version
2010
Platform
Windows
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]
 

TOKYOJ1

New Member
Joined
Aug 14, 2017
Messages
30
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>
 

TOKYOJ1

New Member
Joined
Aug 14, 2017
Messages
30
Hi,

I got it. Formula should be in C2 instead of C1.

My sincere thanks!!!!
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,508
Office Version
2010
Platform
Windows
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:

TOKYOJ1

New Member
Joined
Aug 14, 2017
Messages
30
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!
 

Forum statistics

Threads
1,082,336
Messages
5,364,701
Members
400,811
Latest member
MSBINinja

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top