Hi, I don't know if there is a formla way to solve this, but I mostly use VBA
I added the following code the sheet's vba project:
It's also in the attached file,
Change the number is column B and the min will be calculated for that section.
See if it makes sense, I'll explain more if necessary
I added the following code the sheet's vba project:
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 2 Then Exit Sub
Dim startRow As Long
Dim endRow As Long
Dim minVal As Double
Dim x As Long
endRow = Cells(Rows.Count, 1).End(xlUp).Row
minVal = WorksheetFunction.Max(Range(Cells(1, 1), Cells(endRow, 1)))
If Target.Row = 1 Then
startRow = Target.Row
Else
For x = Target.Row To 1 Step -1
If Cells(x, 2).Value = 0 Then
startRow = x + 1
Exit For
End If
Next x
If startRow < 1 Then startRow = 1
End If
endRow = 0
For x = startRow To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(x, 2).Value = 0 Then
endRow = x - 1
Exit For
End If
Next x
If endRow = 0 Then endRow = Cells(Rows.Count, 1).End(xlUp).Row
For x = startRow To endRow
minVal = WorksheetFunction.Min(minVal, Cells(x, 1).Value)
Next x
Cells(startRow, Target.Column).Offset(0, 3).Value = minVal
End Sub
Change the number is column B and the min will be calculated for that section.
See if it makes sense, I'll explain more if necessary