یك ستون پر از تاریخ دارم، می*خوام نزدیكترین تاریخ (كه كمتر از تاریخ مورد جستجو هست) را در یك ستون تاریخ پیدا كنم تا از اون در تابع vlookup استفاده كنم.
لطفا یه نفر راهنمایی كنه
فایل مثال هم قرار دادم
|
🖤 پیام تسلیتبا نهایت تأسف و تأثر، باخبر شدیم جناب آقای محمد محمدی با نام کاربری smartman ، از مدیران ارزشمند انجمن اکسل ایران، دار فانی را وداع گفتهاند. ایشان سالها با دانش، تجربه، اخلاق نیکو و روحیه کمک به دیگران، سهم بزرگی در رشد و پویایی انجمن داشتند و خاطره حضور ارزشمندشان همواره در ذهن اعضای انجمن باقی خواهد ماند. مدیریت و اعضای انجمن ExcelIran این ضایعه را به خانواده محترم ایشان، دوستان و تمامی اعضای انجمن تسلیت عرض نموده و از خداوند متعال برای آن مرحوم، رحمت و مغفرت الهی و برای بازماندگان صبر و شکیبایی مسئلت دارند.
انا لله و انا الیه راجعون
|
=index(b10:b15;match(b4;c10:c15;1))
Function NearDate(DateTarget As Date, Range As Range) As Variant
Dim Result As Date
For Each Rng In Range
If Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
Function NearDate(DateTarget As Date, Range As Range) As Variant
Dim Result As Date
For Each Rng In Range
If Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
Function NearDate(DateTarget As Date, Range As Range) As Variant
Dim Result As Date
For Each Rng In Range
If Rng = DateTarget Then
Result = DateTarget
Exit For
Else If Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
Function NearDate(DateTarget As Date, Range As Range) As Variant
Dim Result As Date
For Each Rng In Range
If Rng = DateTarget Then
Result = DateTarget
Exit For
Else If Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
Function NearDate(DateTarget As Date, Range As Range) As Date
Dim Result As Date
For Each Rng In Range
If Rng = DateTarget Then
Result = DateTarget
Exit For
ElseIf Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
Function NearDate(DateTarget As Date, Range As Range) As Date
Dim Result As Date
For Each Rng In Range
If Rng = DateTarget Then
Result = DateTarget
Exit For
ElseIf Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
Function NearDate(DateTarget As Date, Range As Range) As Date
Dim Result As Date
For Each Rng In Range
If Rng = DateTarget Then
Result = DateTarget
Exit For
ElseIf Rng < DateTarget Then
Result = Application.WorksheetFunction.Max(Result, Rng)
End If
Next
NearDate = Result
End Function
=INDEX(D8:D13;MATCH(NearDate(C5;C8:C13);C8:C13;0))
کامنت