Using a formula to populate a list of holiday dates from a work rota.

Browneh89

Board Regular
Joined
Mar 8, 2019
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am attempting to write a formula that will list the dates someone has taken holidays from a work rota. I'm not 100% sure the best way to go about this in fact I'm not entirely sure if it's possible at all with the current layout of the rota.

I am thinking possibly an INDEX/MATCH formula with an IF statement but I could be thinking about this in the wrong way.

I'll attach two images to the post of the rota the list needs to pull the data from and what I would like the end game list to look like, would really appreciate if someone could point me in the right direction or if I'm wasting my time attempting to make this work.

I want the formula to be able to recognize the "H" in the row which corresponds with the person and reference the date above in the list.

I hope this all makes sense!
 

Attachments

  • example list and rota.png
    example list and rota.png
    20 KB · Views: 8

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Can you please post some sample data using the XL2BB add-in?

Also please update your account details to show which version of Excel you are using, as this can make a difference to which functions you can use.
 
Upvote 0
Will do!

Also i have updated what you asked.

Struggles.xlsx
ABCDEFGHIJKL
1WednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturday
201-Apr02-Apr03-Apr04-Apr05-Apr06-Apr07-Apr08-Apr09-Apr10-Apr11-Apr
3BOBHHH7-157-157-157-157-157-15
4JAMES7-157-157-157-15HHH7-15
5PAUL14-22HHH14-2214-2214-2214-22
6HOLLYH22-622-622-6HHH
ROTA


Struggles.xlsx
ABCD
1BOBJAMESPAULHOLLY
201-Apr06-Apr03-Apr01-Apr
302-Apr07-Apr04-Apr07-Apr
403-Apr08-Apr05-Apr08-Apr
509-Apr
6
7
8
9
10
11
12
13
How it should look
 
Upvote 0
Sorry, I should have explained.. The top table is the rota I need to pull the data from and the bottom table is how I want it to look.

I want the 2nd table to detect the cells with the letter "H" in them and reference the date above for each row
 
Upvote 0
Upvote 0
Woah this is fantastic and it works perfectly as far as I can see!

This is far in advance of stuff I typically use. I can adjust the formula to suit my needs but do you think you could break it down for me so I can better understand it in case I ever want to use something like this again?

Again thank you very much!
 
Upvote 0
This part
(COLUMN(Rota!$B$2:$L$2)-COLUMN(Rota!$B$2)+1)
returns an array of numbers
{1,2,3,4,5,6,7,8,9,10,11}
This
((Rota!$A$3:$A$6=A$1)*(Rota!$B$3:$L$6="H"))
Checks if the values in A3:A6 match A1 & the values in B3:L6 are H & returns an array of 1 or 0 (true or false)
When the 1st array is divided by the 2nd array you get
{1,2,3,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!;#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!;#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!;#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!,#DIV/0!}

The argument 15 in the aggregate function works the same as the small function, so it find the kth smallest number & the argument 6 tells it to ignore errors
This part
ROWS(A$2:A2)
will return 1 for the first cell, which in turn tells the aggregate to return the 1st smallest number from the array, when it's dragged down to the next row
ROWS(A$2:A2) becomes ROWS(A$2:A3)
which returns 2 & so the aggregate returns the 2nd smallest number from the array, etc.
These numbers are then used in the index function to return the relevant cell.

HTH
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

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