Dynamic list of unique values based on dates range

Yhadax

New Member
Joined
Feb 18, 2019
Messages
3
Hi all!

I need help with a formula, would be great if someone could help :)

My employees data base is in an excel sheet, they work in different projects every day so their time-sheet is split in entries per project.
The idea is to extract who worked during a certain period of time to calculate their payroll - every 2 weeks, dynamically.

The way I have it organized at the moment is the following:

Sheet 1
Data base - only unique values with the names of all my employees in column B and some extra data

Sheet 2
All the time-sheet entries per employee/per day.
Column B = Date of work
Column C = Name of the employee

Sheet 3
A year calendar and the hours calculator, will enter the dates manually every 2 weeks.
B6 = Start date
C6 = End date

I've seen several Arrays formulas online but I don't get to trigger what I need, could you help me please? Do you need any more data to help you understand what I need?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
So the goal would be to choose an employee and the date range and the formula would return the relevant data?

Can you post some sample data?
 
Upvote 0
The idea is to select a Start and End date and get a list of employees, that will change dynamically as we change the dates.

Start date2019-02-08
End date2019-02-11

<colgroup><col><col></colgroup><tbody>
</tbody>


DateEmployee
02-04 John
02-05 Jason
02-06 Pamela
02-07 Pamela
02-08 Sarah
02-09 Mario
02-10 Jason
02-10 John
02-10 Pamela
02-10 Sarah
02-10 Pamela
02-11 Sarah
02-12 Mario
02-13 Jason
02-14 John

<colgroup><col><col></colgroup><tbody>
</tbody>

List of employees worked during the period above (the list updates if the date range changes):

Sarah
Mario
Jason
John
Pamela

<colgroup><col></colgroup><tbody>
</tbody>
 
Upvote 0

Book1
ABCD
1Start date2/8/2019emps worked
2End date2/11/2019John
3Jason
4Pamela
5DateEmployeeSarah
62/4/2019JohnMario
72/5/2019Jason
82/6/2019Pamela
92/7/2019Pamela
102/8/2019Sarah
112/9/2019Mario
122/10/2019Jason
132/10/2019John
142/10/2019Pamela
152/10/2019Sarah
162/10/2019Pamela
172/11/2019Sarah
182/12/2019Mario
192/13/2019Jason
202/14/2019John
Sheet1


In D2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($B$6:$B$20,SMALL(IF(FREQUENCY(IF($B$6:$B$20<>"",IF($A$6:$A$20>=$B$1,IF($A$6:$A$20<=$B$2,MATCH($B$6:$B$20,$B$6:$B$20,0)))),ROW($B$6:$B$20)-ROW(INDEX($B$6:$B$20,1,1))+1),ROW($B$6:$B$20)-ROW(INDEX($B$6:$B$20,1,1))+1),ROWS($D$2:D2))),"")

Using named ranges...

=IFERROR(INDEX(employee,SMALL(IF(FREQUENCY(IF(employee<>"",IF(date>=$B$1,IF(date<=$B$2,MATCH(employee,employee,0)))),ivec),ivec),ROWS($D$2:D2))),"")

where ivec is defined in the Name Manager as referring to:

=ROW(employee)-ROW(INDEX(employee,1,1))+1
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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