Formula to give employee role at the time of the DOS in timesheets

ejackson02

New Member
Joined
Oct 10, 2023
Messages
4
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
Roles Data

Employee IDStart DateEnd DateJob Title
Kate Willson 1/1/20236/3/2023Deputy Director
Kate Willson 6/4/202312/31/2040Director
Jane Doe1/1/20236/4/2023Policy Consultant
Jane Doe6/4/202312/31/2040Senior Policy Consultant
Clay Brown1/1/20236/5/2023HR Generalist
Clay Brown6/4/202312/31/2040Senior HR Generalist
Kelly Price1/1/20236/6/2023Junior Policy Consultant
Kelly Price6/4/202312/31/2040Policy Consultant


Timesheet Data
DOSEmployeeJob Title
1/1/2023​
Kate Willson
6/4/2023​
Kate Willson
6/22/2023​
Kate Willson
6/23/2023​
Kate Willson
3/6/2023​
Jane Doe
3/7/2023​
Jane Doe
6/22/2023​
Jane Doe
6/23/2023​
Jane Doe
1/1/2023​
Clay Brown
6/4/2023​
Clay Brown
6/22/2023​
Clay Brown
6/23/2023​
Clay Brown
3/6/2023​
Kelly Price
3/7/2023​
Kelly Price
6/22/2023​
Kelly Price
6/23/2023​
Kelly Price


I would like the role at the time of the DOS as a third column in the timesheet data.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
try this
--------------------
Book1
ABCDEFGHI
1Employee IDStart DateEnd DateJob TitleDOSEmployeeJob Title
2Kate Willson1/1/20236/3/2023Deputy Director1/1/2023Kate WillsonDeputy Director
3Kate Willson6/4/202312/31/2040Director6/4/2023Kate WillsonDirector
4Jane Doe1/1/20236/4/2023Policy Consultant6/22/2023Kate WillsonDirector
5Jane Doe6/4/202312/31/2040Senior Policy Consultant6/23/2023Kate WillsonDirector
6Clay Brown1/1/20236/5/2023HR Generalist3/6/2023Jane DoePolicy Consultant
7Clay Brown6/4/202312/31/2040Senior HR Generalist3/7/2023Jane DoePolicy Consultant
8Kelly Price1/1/20236/6/2023Junior Policy Consultant6/22/2023Jane DoeSenior Policy Consultant
9Kelly Price6/4/202312/31/2040Policy Consultant6/23/2023Jane DoeSenior Policy Consultant
101/1/2023Clay BrownHR Generalist
116/4/2023Clay BrownHR Generalist
126/22/2023Clay BrownSenior HR Generalist
136/23/2023Clay BrownSenior HR Generalist
143/6/2023Kelly PriceJunior Policy Consultant
153/7/2023Kelly PriceJunior Policy Consultant
166/22/2023Kelly PricePolicy Consultant
176/23/2023Kelly PricePolicy Consultant
index match between dates
Cell Formulas
RangeFormula
I2:I17I2=INDEX($D$2:$D$9,MATCH(1,INDEX((H2=$A$2:$A$9)*(G2>=$B$2:$B$9)*(G2<=$C$2:$C$9),0,1),0))
 
Upvote 0
Hello ExceLoki,

Thank you for your reply. I copied and pasted your solution into a black excel workbook and the resultant I get are #NA's. Did I miss something?
1697471142815.png
 
Upvote 0
i see in your profile you use several versions of office, which one did you paste it into?
 
Upvote 0
Based on what I have tested in MS 365, the following formula should work:

=INDEX($D$2:$D$9,MATCH(1,(H2=$A$2:$A$9)*(G2>=$B$2:$B$9)*(G2<=$C$2:$C$9),0))
 

Attachments

  • Excel Sample.JPG
    Excel Sample.JPG
    108.9 KB · Views: 4
Upvote 0
usually the first things i'd check are extra space in the data or the cell formats- making sure they match, but if you copied and pasted into a new workbook... i'm not sure why it's not working
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,122
Members
452,381
Latest member
Nova88

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