Forum Discussion
Create a calendar from dates start and end
- Sep 27, 2022
I came in to write out an explanation of how that formula works and realized there is a mistake in it, such that it worked well for that first example, but probably would not continue to work for all of the different ref items. A revised formula in a new spreadsheet is attached.
So here's a revised formula.
=IFERROR(LET(datearray,FILTER(BASE!$M2:$M6722,BASE!$A2:$A6722=$D5),status,MATCH(E$1,datearray,1),Wharray,FILTER(BASE!$L2:$L6722,BASE!$A2:$A6722=$D5),INDEX(Wharray,status)),"---")
By the way, doing this every day for so many years and so many items is a major consumer of computer power. You might want to reconsider your design, or only do a few rows at a time and then save the results as values rather than as formulas.
So let me break it down, from the inside out, explaining what the LET function does along the way.
FILTER(BASE!$M2:$M6722,BASE!$A2:$A6722=$D5)
This creates an array of the dates from your Base tab where the Ref equals what is in column D of "Calendar" -- so an array of the dates for Ref 18535, for example
LET then assigns that array to the temporary name "datearray"
FILTER(BASE!$L2:$L6722,BASE!$A2:$A6722=$D5)
Similarly, this creates an array of the data in column L (which you'll see I changed) where Ref equals column D of Calendar tab
LET then assigns that array to the temporary name "WHarray" (for Warehouse array)
MATCH(E$1,datearray,1)
Finds the first row in dataarray that is less than the date on the top row of the Calendar tab; LET assigns that value to "status"
INDEX(Wharray,status)
Uses status to find the word in WHarray that's in the same row -- which is why I changed those to be "Available" "Worksite" etc
the IFERROR function serves to take dates where there is no record and returns a blank (to make the spreadsheet easier to see; I initially had it return "No Rec" but that text doesn't really function helpfully.
thank for your help !
https://bouyguesconstruction-my.sharepoint.com/:x:/r/personal/d_jamin_bouygues-es_com/Documents/Bureau/TX%20rotation.xlsx?d=w21084c6bb0814f28ba0015fc5dadda3b&csf=1&web=1&e=lyEWgS
on the sheet calendar there is a table, i made it "manually", of course my goal is to see this table automatically fill in
I hope that will be more clear !
It appears your workbook is behind a login wall. When I signed in with my MS account, I received an error saying I don't have access.
- JAMIN85Sep 27, 2022Copper Contributorhttps://bouyguesconstruction-my.sharepoint.com/:x:/g/personal/d_jamin_bouygues-es_com/EWtMCCGBsChPugAV_F2t2jsBPOUu9zPSUb0UbVVYSvGM4w?e=YC0Ddl
I changed the rights but i'm not sure...
i'm trying to sned it in another account- JAMIN85Sep 27, 2022Copper Contributorhttps://docs.google.com/spreadsheets/d/1JWVXMUaJGV-c37hPz0HBy8ic5yeCPH2G/edit?usp=sharing&ouid=106627487551338560449&rtpof=true&sd=true
I put it in a googledrive- mathetesSep 27, 2022Gold Contributor
OK, now we can see it. But some help in understanding what we're seeing would come in handy.
So far as I can see, the data in columns B, C and D is the same in every one of the rows. The others do change, but what are they--what do they represent and how do they pertain to the task you are wanting to accomplish?