Вы должны будете поместить это в новый модуль в редакторе VBE и просто указать свое имя листа ниже в коде.Он печатает результаты для каждого столбца на 2 строки ниже нижней части каждого столбца.
Sub checker()
Dim row As Long
Dim lastrow As Long
Dim col As Integer
Dim dif As Double
Dim minRow As Long: minRow = 1
Dim startRow
With ThisWorkbook.Worksheets("Enter your sheet name")
' change 1 to 2 below if your first row is a header not a data value
startRow = 1
' starting at col D
For col = 4 to 4 + (3*12) Step 3
dif = Abs(.Cells(startRow, col) - .5)
lastRow = .Cells(.Rows.Count, col).End(xlUp).Row
For row = startRow To lastRow
If Abs(.Cells(row, col).Value - .5) < dif Then
dif = Abs(.Cells(row, col).Value - .5)
minRow = row
End If
Next
' print result at bottom of ea row
.Cells(lastRow + 2, col).Value = "Row: " & minRow & ", dif: " & dif & ", value: " & .Cells(minRow, col).Value
Next
End With
End Sub
Удачи