Google sheets calendar with dynamic content - google-sheets

i have a google sheet with two tabs. First tab is all the reservations data i have for a house i rent (First Name, Last Name, Check in Date, Check out Date etc...) and in the second tab is a calendar. I am looking for a way, when i add a new row in the reservations tab automatically that reservation to be added in the calendar in the correct days.
This the google sheets link
https://docs.google.com/spreadsheets/d/1oh7Pvj8G8_fnVWifiED9XS7bOCxOan8E46-Ku1UJu7s/edit?usp=sharing

First, build in 'μήνας' tab a table as
For calendar, put this function in B2 (no merged cells anymore except the title), nothing in C2, D2 ... and format as dd
=sequence(1;datedif((A1&"-"&vlookup(B1;'μήνας'!A:B;2;0)&"-"&1);eomonth((A1&"-"&vlookup(B1;'μήνας'!A:B;2;0)&"-"&1);0);"d")+1;(A1&"-"&vlookup(B1;'μήνας'!A:B;2;0)&"-"&1))
Finally, your function is in B3
=if(SUMPRODUCT((RESERVATIONS!$A$2:$A=$A3)*(RESERVATIONS!$D$2:$D<=B$2)*(RESERVATIONS!$F$2:$F>=B$2));"x";)
drag to the right and below
To retrieve the name
=iferror(TEXTJOIN(" ";;query(RESERVATIONS!$A:$G;"select C,B where A="&$A3&" and D<=DATE'"&TEXT(B$2;"yyyy-MM-dd")&"' and F>=DATE'"&TEXT(B$2;"yyyy-MM-dd")&"' ";0)))

Related

Is there a feature/formula in Google Sheets that can Transfer info to another sheet if the checkbox is clicked?

Lets say we have 3 sheets, and a employee Jeff.
The Sheets are:
All Employees
Employee's Payments
Employee's Fired
Is there a formula, condition, filter or what-not where if I press on a checkbox, it blacks-out/deletes Jeff from "All Employee's" and "Employee's Payments", and moves his info to the "Employee's Fired" sheet.
And if I remove the check-mark on his info, he gets added back, and removed from the "Employee's Fired" sheet?
=FILTER('Employee''s Fired'!A2:A, 'Employee''s Fired'!B2:B<>TRUE, 'Employee''s Fired'!B2:B<>"")
demo sheet

How to get the related date if the company name is duplicated in Google Sheets?

I am trying to get the date corresponding to the company name if the company name is duplicated.
Public google sheet
Company date
date
duplicated company date
one
jan1
two
jan1
one
feb1
jan1 (find this using some formula)
two
feb4
jan1
two
mar3
feb4 (if repeated take the previous date)
three
apr1
four
apr5
There is no good way to do this. Especially if we don't know why we are doing this in the first place.
The closest I could get is using FILTER:
=IFERROR(INDEX(FILTER($B$2:$B2;$A$2:$A2=$A3);COUNTA(FILTER($B$2:$B2;$A$2:$A2=$A3)));"")
Place this in the second row of your data (the 3rd row of your table if you have headers), because it will not work for the first row. Then, you drag this formula down for all your rows.
Note:
A2 is where I had the first company, like "Apple"
B2 is where I had the first date, like "Jan 1"
You can place this formula in C3, and drag-copy to all rows beneath it using the colored square in the bottom-right corner of the cell you have highlighted.
(In case you didn't know)
Have fun! ^_^

google Sheet formula of shift

I have a cell with today’s date "like cell j11", and I have a "table shifts employee" that contains the numbered beginning of the month to its end, and the table contains data. I want to design a dashboard. If today’s date is equal to the date in the table, it shows me the name of the employees at the time of shift and the data written for the day. I need the formula.
You can combine the =today() function with a =vlookup() against your table to return the correct row of what you are looking for. The formulas are displayed in the image under the relevant cells.
In this example it finds todays date, and looks up the relevant date in the table, and returns the data you want to see into F5 and G5.

How to get the latest Title of the employee once he or she gets promoted in Google Sheets?

I am trying to get the Title of the employee once he or she gets promoted.
I have the data of the employees logged the time in the timesheet that means I have the date with month in a sheet called the Main sheet. There is one helper sheet I have built that has the promotion details. Now I want to get these titles on the Main sheet.
Use Cases:
For instance, In the Main sheet, we have the data like this:
Date Name Hours Title
2019-01 Max King 10 to get from Helper Sheet
2019-02 Max King 20 to get from Helper Sheet
2019-03 Max King 30 to get from Helper Sheet
Now in the Helper Sheet, I have this data
Date Name Title
2019-01 Max King Trainee
2019-03 Max King Senior
Now in the above scenario, I dont have 2019-02 date in the Helper sheet so that I can easily bring the Title. In the Main Sheet, Against 2019-02 I want to bring the title Trainee.
Can someone please guide me?
Thanks
Here is the link to data:
https://docs.google.com/spreadsheets/d/1hfXCFTp_vLqPFjazM-Vo6-3o8J1td1zpnCJOeK1LBg0/edit?usp=sharing
Helper Sheet
Main Sheet
I have added a new sheet ("Erik Help") with the following formula in C1:
=ArrayFormula({"Title";IF(A2:A="",,IFERROR(VLOOKUP(A2:A&B2:B,SORT(FILTER({Helper!B2:B&Helper!A2:A,Helper!D2:D},Helper!B2:B<>"")),2,TRUE),"NOT FOUND"))})
This one formula produces the header and all results for C2:C.
You may change the header text within the formula as you like.
Essentially, the combined name-date is looked up within a sorted virtual array of the name-date and title from the "Helper" sheet, and the title (column 2 of that array) is returned if found. The final parameter of the VLOOKUP is TRUE, which means the search column is in strict sorted order and, if no exact match is found, to back up and grab the closest match before the searched one.

query one sheet based on cell in another sheet

My master data sheet is named MASTER.
In my sheet named PRINT I want to be able to use a date picker, or somehow be prompted for a date, and then a Query pulls data from Master where date selected matches dates in MASTER column B. I have tried the following Query statement but it will only work if I change both sheets Date columns to TEXT format. I need to keep my date formats as is. If all that makes sense, I would really appreciate some help. My end goal is I just want a huge list of fabrication jobs, listed by date, to be queried and pulled to another sheet for printing. Leaving all Master data in tact and where the PRINT sheet can simply have a date change done by any user and get the list they need.
=Query(MASTER!A:P,ʺselect * where B ='ʺ&A2&ʺ'ʺ,0)
The above Query is on my TEST sheet where I have a date picker in column A2
Try:
=Query(MASTER!A:P,"select * where B =date"""&text(A2, "yyyy-mm-dd")&""" ",0)
and see if that works for you ?

Resources