Lookup multiple Criteria

chadlaw32

Board Regular
Joined
Jul 29, 2014
Messages
84
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I am trying to dump yearly data into a sheet then on another tab pull the info based off a name and the date entered.
Column A Date
Column B Name
Column C through M is data to pull
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Let me try that and see if it does what I need
 
Last edited:
Upvote 0
That is not doing what i need are there any other ideas for how I can get this done. To give more detail I am making a sheet so that people can put in a date or a date range and the sheet will pull call stats for that time period.
 
Upvote 0
This works and gives you somewhere to start
- modify to suit your needs

This was the original sheet
- From date is selected in cell X1
- To date is selected in cell Z1

Excel 2016 (Windows) 32 bit
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
1
DATENAMECdefghijklmFrom
15/03/2019​
To
15/03/2019​
2
22/02/2019​
name01c01
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
3
28/02/2019​
name02c02
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
4
13/03/2019​
name03c03
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
5
05/03/2019​
name04c04
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
6
21/02/2019​
name05c05
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
7
17/03/2019​
name06c06
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
8
15/03/2019​
name07c07
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
9
10/03/2019​
name08c08
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
10
14/02/2019​
name09c09
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
11
11/03/2019​
name10c10
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
12
15/02/2019​
name11c11
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
13
22/02/2019​
name12c12
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
14
03/03/2019​
name13c13
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
15
07/03/2019​
name14c14
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
16
05/03/2019​
name15c15
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
17
10/02/2019​
name16c16
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
18
15/03/2019​
name17c17
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
19
15/03/2019​
name18c18
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
Sheet: 11

This is what was created by the macro
Excel 2016 (Windows) 32 bit
A
B
C
D
E
F
G
H
I
J
K
L
M
1
DATENAMECdefghijklm
2
15/03/2019​
name07c07
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
3
15/03/2019​
name17c17
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
4
15/03/2019​
name18c18
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
5
15/03/2019​
name88c88
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
6
15/03/2019​
name129c129
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
7
15/03/2019​
name137c137
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
8
15/03/2019​
name138c138
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
9
15/03/2019​
name149c149
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
10
15/03/2019​
name166c166
1​
1​
1​
1​
1​
1​
1​
1​
1​
1​
Sheet: Sheet23


Run from the sheet containing data - data assumed to start in A1
Code:
Sub FilterByDate()
        Dim ws As Worksheet
    With ActiveSheet
        Dim c1  As Long:        c1 = .Range("X1").Value      'from date
        Dim c2  As Long:        c2 = .Range("Z1").Value      'to date
        
        On Error Resume Next:   .ShowAllData:   On Error GoTo 0
'filter the data
        .Range("A1").AutoFilter
        .Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:=">=" & c1, Operator:=xlAnd, Criteria2:="<=" & c2
        .Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
'paste data to new sheet
        Set ws = Sheets.Add
        ws.Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteColumnWidths
        ActiveSheet.Paste
    End With
End Sub
 
Upvote 0
The people using the sheet did not like those options so i ended up going with

=IFERROR(INDEX('Data Dump'!G:G,MATCH(Daily!$F$1&Daily!$A7,'Data Dump'!$A:$A&'Data Dump'!$B:$B,0)),"")
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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