Populate Data Based on Criteria

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
951
Office Version
  1. 365
Hi,

I have the following table in sheet 1:

Book1
BCDEFGHIJKLMNOPQRSTUVW
2Table 1
3MonthDateBranchStaffTask1Task2Task3Task4Task5Task6Task7Task8Task9Task10Task11Task12Task13Task14Task15Task16Task17Task18
4JanMonday, 2 January, 2023TexasStaff1101010101010101010101010101010101010
5JanTuesday, 3 January, 2023New YorkStaff2101010101010101010101010101010101010
6JanWednesday, 4 January, 2023OklahomaStaff3101010101010101010101010101010101010
7FebWednesday, 1 February, 2023TexasStaff1101010101010101010101010101010101010
8FebThursday, 2 February, 2023New YorkStaff2101010101010101010101010101010101010
9FebFriday, 3 February, 2023OklahomaStaff3101010101010101010101010101010101010
10MarWednesday, 1 March, 2023TexasStaff1101010101010101010101010101010101010
11MarThursday, 2 March, 2023New YorkStaff2101010101010101010101010101010101010
12MarFriday, 3 March, 2023OklahomaStaff3101010101010101010101010101010101010
Sheet1


In Sheet 2, I have the following table where I would likeusers can enter the crietria:

Book1
BCDEF
15Table 2
16MonthBranchStaffStart DateEnd Date
17JanTexasStaff12/1/20233/3/2023
Sheet1


The correct result should populate as below in Table 3:
Book1
BCDEFGHIJKLMNOPQRSTUVW
20Table 3
21MonthDateBranchStaffTask1Task2Task3Task4Task5Task6Task7Task8Task9Task10Task11Task12Task13Task14Task15Task16Task17Task18
22JanMonday, 2 January, 2023TexasStaff1101010101010101010101010101010101010
23FebWednesday, 1 February, 2023TexasStaff1101010101010101010101010101010101010
24MarWednesday, 1 March, 2023TexasStaff1101010101010101010101010101010101010
Sheet1


Is there a way to build formula in Table 3 to populate data based on the criterias entered in Table 2 in Table 3? Appreciate all the help.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
How about
Excel Formula:
=FILTER(B4:W12,(C4:C12>=E17)*(C4:C12<+F17)*(D4:D12=C17)*(E4:E12=D17))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hi Fluff,

If I have the similar table in sheet 1, sheet2, sheet3:

Book2
BCDEFGHIJ
2Sheet1
3MonthDateBranchStaffTask1Task2Task3Task4Task5
4Jan1/1/2023TexasJavier1010101010
5Jan1/1/2023OhioMichael1010101010
6Jan1/1/2023New YorkJenny1010101010
7Jan1/1/2023VirginiaPaulina1010101010
8Jan1/1/2023ColoradoNoell1010101010
9Jan2/1/2023TexasJavier1010101010
10Jan2/1/2023OhioMichael1010101010
11Jan2/1/2023New YorkJenny1010101010
12Jan2/1/2023VirginiaPaulina1010101010
13Jan3/1/2023ColoradoNoell1010101010
14
15
16Sheet2
17MonthDateBranchStaffTask1Task2Task3Task4Task5
18Feb1/2/2023TexasJavier1010101010
19Feb1/2/2023OhioMichael1010101010
20Feb1/2/2023New YorkJenny1010101010
21Feb1/2/2023VirginiaPaulina1010101010
22Feb1/2/2023ColoradoNoell1010101010
23Feb2/2/2023TexasJavier1010101010
24Feb2/2/2023OhioMichael1010101010
25Feb2/2/2023New YorkJenny1010101010
26Feb2/2/2023VirginiaPaulina1010101010
27Feb3/2/2023ColoradoNoell1010101010
28
29
30Sheet3
31MonthDateBranchStaffTask1Task2Task3Task4Task5
32Mar3/3/2023TexasJavier1010101010
33Mar3/3/2023OhioMichael1010101010
34Mar3/3/2023New YorkJenny1010101010
35Mar3/3/2023VirginiaPaulina1010101010
36Mar3/3/2023ColoradoNoell1010101010
37Mar4/3/2023TexasJavier1010101010
38Mar4/3/2023OhioMichael1010101010
39Mar4/3/2023New YorkJenny1010101010
40Mar4/3/2023VirginiaPaulina1010101010
41Mar5/3/2023ColoradoNoell1010101010
Sheet1



In Sheet4, I have Table 1 where users can enter the criteria and Table 2 where the data populates automatically. The correct result is in table 2 based on the criteria in table 1. I tried modfying the earlier Filter solution but it did not work. Will Filter fundtion not work across multiple sheet ? Appreciate the help:

Book2
MNOPQRSTU
2Table 1: Enter Criteria
3MonthBranchStaffStart DateEnd Date
4JanTexasJavier1/1/20235/3/2023
5
6
7Table 2: Result
8MonthDateBranchStaffTask1Task2Task3Task4Task5
9Jan1/1/2023TexasJavier1010101010
10Jan2/1/2023TexasJavier1010101010
11Feb1/2/2023TexasJavier1010101010
12Feb2/2/2023TexasJavier1010101010
13Mar3/3/2023TexasJavier1010101010
14Mar4/3/2023TexasJavier1010101010
Sheet1
 
Upvote 0
You would be far better off keeping all the data in one sheet, it makes analysing it much easier.
 
Upvote 0
Hi Fluff,

I absolutely agree. Unfortunately due to the user requirements, the file is currently set up in such a way. Is there a way to build the search table across multiple sheets ?
 
Upvote 0
Do you have the VSTACK function?
 
Upvote 0
Ok, how about
Excel Formula:
=LET(v,VSTACK(Sheet1:Sheet3!B4:W12),FILTER(v,(INDEX(v,,2)>=E17)*(INDEX(v,,2)<=F17)*(INDEX(v,,3)=C17)*(INDEX(v,,4)=D17)))
but all 3 sheets must be consecutive sheets
 
Upvote 0
Solution

Forum statistics

Threads
1,223,250
Messages
6,171,036
Members
452,374
Latest member
keccles

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