Automation in Google Sheets

hj121479

New Member
Joined
Jan 18, 2023
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm trying to build automation for below -

1674072389162.png


If Name A requested a vacation from 1/20/2023 to 1/24/2023 (C2 and D2), in the below chart, I am hoping to automatically match the dates and "Vacation" wording from Column E2.

Thank you for your help in advance.
 
Last edited by a moderator:

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What should be your expected result.
can you post some examples?
 
Upvote 0
Is this for Google sheets, or Excel?
 
Upvote 0
In that case you should make that clear in your title (rather than referring to Excel) & such questions should be posted in the General Discussion & Other Applications section of the board.
I have done that for you this time.
 
Upvote 0
Try

Book2
ABCDEFGHIJKLM
1Start DateEnd DateReason
2Name A1/20/20231/24/2023Vacation
3Name B1/25/20231/29/2023Off
4Name C1/21/20231/21/2023Vacation
5
6FriSatSunMonTueWedThuFriSatSunMon
71/20/20231/21/20231/22/20231/23/20231/24/20231/25/20231/26/20231/27/20231/28/20231/29/20231/30/2023
8Name AVacationVacationVacationVacationVacation
9Name BOffOffOffOffOff
10Name CVacation
11
12
13
14
Sheet3
Cell Formulas
RangeFormula
D2:D4D2=INDEX($C$7:$M$7,,MATCH(F2,$C8:$M8,0))
E2:E4E2=INDEX($C$7:$M$7,,MATCH(MAXIFS($C$7:$M$7,$C8:$M8,F2),$C$7:$M$7,0))
F2:F4F2=INDEX($C$8:$M$10,MATCH($C2,$B$8:$B$10,0),MATCH("*",$C8:$M8,0))
 
Upvote 0
Try

Book2
ABCDEFGHIJKLM
1Start DateEnd DateReason
2Name A1/20/20231/24/2023Vacation
3Name B1/25/20231/29/2023Off
4Name C1/21/20231/21/2023Vacation
5
6FriSatSunMonTueWedThuFriSatSunMon
71/20/20231/21/20231/22/20231/23/20231/24/20231/25/20231/26/20231/27/20231/28/20231/29/20231/30/2023
8Name AVacationVacationVacationVacationVacation
9Name BOffOffOffOffOff
10Name CVacation
11
12
13
14
Sheet3
Cell Formulas
RangeFormula
D2:D4D2=INDEX($C$7:$M$7,,MATCH(F2,$C8:$M8,0))
E2:E4E2=INDEX($C$7:$M$7,,MATCH(MAXIFS($C$7:$M$7,$C8:$M8,F2),$C$7:$M$7,0))
F2:F4F2=INDEX($C$8:$M$10,MATCH($C2,$B$8:$B$10,0),MATCH("*",$C8:$M8,0))

Thank you but I'm trying to do it vice verse. From the data you have from C1 to F4, I'm trying to pull a chart in b6 to m10. Would you please help?
 
Upvote 0
Try

Book2
ABCDEFGHIJKLM
1Start DateEnd DateReason
2Name A1/20/20231/24/2023Vacation
3Name B1/25/20231/29/2023Off
4Name C1/21/20231/21/2023Vacation
5
6FriSatSunMonTueWedThuFriSatSunMon
71/20/20231/21/20231/22/20231/23/20231/24/20231/25/20231/26/20231/27/20231/28/20231/29/2023 
8Name AVacationVacationVacationVacationVacation      
9Name B     OffOffOffOffOff 
10Name C Vacation         
11
12
13
14
15
16
Sheet3 (2)
Cell Formulas
RangeFormula
C7C7=MIN($D$2:$D$4)
D7:M7D7=IF(C7<MAX($E$2:$E$4),C7+1,"")
C8:M10C8=IF(AND(C$7<=INDEX($E$2:$E$4,MATCH($B8,$C$2:$C$4,0)),C$7>=INDEX($D$2:$D$4,MATCH($B8,$C$2:$C$4,0))),INDEX($F$2:$F$4,MATCH($B8,$C$2:$C$4,0)),"")
 
Upvote 0
Try

Book2
ABCDEFGHIJKLM
1Start DateEnd DateReason
2Name A1/20/20231/24/2023Vacation
3Name B1/25/20231/29/2023Off
4Name C1/21/20231/21/2023Vacation
5
6FriSatSunMonTueWedThuFriSatSunMon
71/20/20231/21/20231/22/20231/23/20231/24/20231/25/20231/26/20231/27/20231/28/20231/29/2023 
8Name AVacationVacationVacationVacationVacation      
9Name B     OffOffOffOffOff 
10Name C Vacation         
11
12
13
14
15
16
Sheet3 (2)
Cell Formulas
RangeFormula
C7C7=MIN($D$2:$D$4)
D7:M7D7=IF(C7<MAX($E$2:$E$4),C7+1,"")
C8:M10C8=IF(AND(C$7<=INDEX($E$2:$E$4,MATCH($B8,$C$2:$C$4,0)),C$7>=INDEX($D$2:$D$4,MATCH($B8,$C$2:$C$4,0))),INDEX($F$2:$F$4,MATCH($B8,$C$2:$C$4,0)),"")
Thank you so much! This is really helpful!

One quick question - If I want to bring the timesheet from a different workbook, how should I use IMPORTRANGE formula to the 'IF(AND(C$7<=INDEX($E$2:$E$4,MATCH($B8,$C$2:$C$4,0)),C$7>=INDEX($D$2:$D$4,MATCH($B8,$C$2:$C$4,0))),INDEX($F$2:$F$4,MATCH($B8,$C$2:$C$4,0)),"")' formula?
 
Upvote 0

Forum statistics

Threads
1,216,130
Messages
6,129,064
Members
449,485
Latest member
greggy

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