Getting info from a date range

hunytaco

New Member
Joined
Aug 9, 2017
Messages
9
If I have a list of names in column A and various dates in columns B through E, can I create a formula that pulls names from A if it falls withing a date range of those listed between B and E?

Thanks in advance!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Here is a Macro solution for you. Assumes your dates to search between are in H1 and I1. Highlights Column A with positive results in Red

Code:
Option Explicit


Sub FindName()
    Dim i As Long
    Dim lr As Long
    Dim mMax As Date
    Dim mMin As Date
    Dim rng As Range, c As Range
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 1 To lr
        Set rng = Range("B" & i & ":E" & i)
        mMin = Range("H1")
        mMax = Range("I1")
        For Each c In rng
            If c > mMin And c < mMax Then
                Range("A" & i).Interior.ColorIndex = 3
            End If
        Next c
    Next i
End Sub
 
Last edited:
Upvote 0
Here is a Macro solution for you. Assumes your dates to search between are in H1 and I1. Highlights Column A with positive results in Red

Code:
Option Explicit


Sub FindName()
    Dim i As Long
    Dim lr As Long
    Dim mMax As Date
    Dim mMin As Date
    Dim rng As Range, c As Range
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 1 To lr
        Set rng = Range("B" & i & ":E" & i)
        mMin = Range("H1")
        mMax = Range("I1")
        For Each c In rng
            If c > mMin And c < mMax Then
                Range("A" & i).Interior.ColorIndex = 3
            End If
        Next c
    Next i
End Sub

Thanks for this! I'll try this out now. Any chance this could be translated to a formula?
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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