I want to create a calendar in Excel with 2 sheets:
Actual monthly calendar
Display current week of the month AND cells displaying data accordingly
Task: I want to show the people who are working this week rather than the whole month.
I got the code for current week display:
=TEXT(TODAY()-WEEKDAY(TODAY(),3),"mmmm dd, yyyy")&" - "&TEXT(TODAY()-WEEKDAY(TODAY(),3)+6,"mmmm dd, yyyy")
So, this will show the current eeek starting on Monday and ending on Sunday (as I needed to display)
Now:
On sheet 2, I want to show ONLY the dates of week on the calendar based on this above calculation.
Match the week start date to a list of Mondays in a different tab, then display the name of the person on the cells below the matching date (this is VLOOKUP, HLOOKUP)
Have this automatically updated every week with correct info
Is it possible? How?
I am not a coder at all.
In a blank sheet (Sheet2):
A2 =TODAY()
A4 delta
A5 to A19 consecutive values from -7 to 7
B4 Today+delta
C4 Weeknum
D4 Weekday
E4 Key
F4 Today+delta (again)
B5 =$A$2+A5 and then replicate this formula until B19
C5 =WEEKNUM(B5)
D5 =WEEKDAY(B5)
E5 =CONCATENATE(C5,"-",D5)
F5 =B5
Now extend those formulas (B5:F5) until row 19 (B19:F19)
In another blank sheet (Sheet1)
In the firs row put your formula
A2 to G2 consecutive values from 1 to 7
A3 =CONCATENATE(WEEKNUM(TODAY()),"-",A2)
Extend that formula in the range A3:G3
A4 to G4 Weekday names from Monday to Sunday
A5 =VLOOKUP(A$3, Sheet2!$E$5:$F$19, 2, 0)
Extend that formula in the range A5:G5
Until now, you should have Sheet1 with the requirement of the week showing every day of the current week. If you need a different week, just change the value in Sheet2!A2 adding or substracting days.
Related
If someone has a better solutions please let me know, but this is what I came up with to calculate the first, last, and Nth specified weekdays for a given month/year.
Cell B3: dropdown values for First, Second, Third, Fourth, Last
Cell C3: dropdown values for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Cell A6 = Year (4 digit integer)
Cell B6 = Month (integer)
Cell B2: =IF(B3="First",1,IF(B3="Second",2,IF(B3="Third",3,IF(B3="Fourth",4,5))))
Cell C2: =IF(C3="Sunday",16,IF(C3="Monday",17,IF(C3="Tuesday",11,IF(C3="Wednesday",12,IF(C3="Thursday",13,IF(C3="Friday",14,15))))))<br>
Cell C6: =IF(B2<5,DATE(A6,B6,B2*7+1)-WEEKDAY(DATE(A6,B6,B2*7-1),C2),EOMONTH(DATE(A6,B6,1),0)-MOD(WEEKDAY(EOMONTH(DATE(A6,B6,1),0)+5,C2),7))
Cell C2 drives the seleted weekday: 11(Tuesday), 12(Wed), 13(Thr), 14(Fri), 15(Sat), 16(Sun), 17(Monday)
I also calculate first and last day of the month with this code:
=DATE(A6,B6,1)
=EOMONTH(DATE(A6,B6,1),0)
Thank for any feedback.
I have a spreadsheet with the days of the month (in DD/MM/YYYY format) running across row 1 and values in each column downwards that correspond to the day above, with a trigger value in the last column, for example:
02/01/2000|03/01/2000|trigger
1000 |1000 |1100
560 |3400 |1000
Where 02/01/2000 is in A1
I'm looking to create a conditional formatting statement to colour cells that have a corresponding row 1 WEEKDAY value of Sunday (7), and if they're lower in value compared to the trigger value for their row.
For example, format A2:B2 if A1:B1 is a Sunday and A2:B2 < C2 which I'd like to format A2 but leave B2 as it doesn't meet the Sunday criteria.
Then format A3:B3 if A1:B1 is a Sunday and A3:B3 < C3 in which A3 is lower than C3 but it's corresponding date above in A1 isn't a Sunday.
I know I can format cells based on their weekday with =WEEKDAY(A1:B1)=7 and compare values in the row to the trigger value with =A2:B2=<$C$2 but any attempts to combine the two doesn't seem to work (and without an absolute cell reference for C2, that formula seems to highlight the wrong cells).
I would appreciate any suggestions or help!
format A2:B2 if A1:B1 is a Sunday and A2:B2 < C2 ... Then format A3:B3 if A1:B1 is a Sunday and A3:B3 < C3
Grab all of column A:B with A1 as the 'active cell' and create a CFR based on this formula,
=and(weekday(a$1)=1, a1<c1, row()>1)
I'm trying to use AVERAGEIFS not sure if that's the best but here is the issue. Reporting in the new year is a PITA, the spreadsheet has dates in column A with the corresponding value in column B in 7 day increments for example Cell A1 1/7/18 Cell B1 95%, Cell A2 1/14/18 Cell B2 100%, Cell A3 1/21/18 Cell B3 62%, this goes on for the entire year. In a different cell, say C1 id like to see the average for January, in cell C2 Feb and so on.
Simplest to add another column with month or month and year (if you have multiple years worth of data), e.g. in C1 copied down
=MONTH(A1)
....and then average for January is simply
=AVERAGEIF(C:C,1,B:B)
Repeat for other months
Assuming that you are not trying to proportion the percentage in a week that straddles January to February then this for January,
=AVERAGEIFS(B:B, A:A, ">="&DATE(2018, ROW(1:1), 1), A:A, "<"&DATE(2018, ROW(1:1)+1, 1))
Fill down for subsequent months.
I was wondering if it's possible to use info from a cell in creating a formula. Here's the situation;
A1 = Date (01/01/17)
A2 = Month from that date (January)
I have different worksheets in the book for every month so for January the sheet is called January.
Is it possible to create a formula where I can reference a cell in a page that corresponds to the month in A2.
So for example in A3 the formula would be =January!A1
But instead of Jan I want it to be dynamic so it would change to any month depending on what I input in previous cells.
In A2 to get the month try
=TEXT(A1,"mmmm")
and then in A3
=INDIRECT(A2&"!A1")
or you can cut out A2 altogether and use just
=INDIRECT(TEXT(A1,"mmmm")&"!A1")
I have to build a report that has two different date columns in it; M-F of the previous month, and T-S of the previous month.
If in column A I have a list of all days from the previous month
A
1 | 8/1/2013 |
2 | 8/2/2013 |
...
31 | 8/31/2013 |
Is there a formula that could be used in columns B and C to get the necessary dates?
Well, sure, you can use this formula to avoid the blank cells in between the dates:
=IFERROR(INDEX($A$1:$A$31,SMALL(IF(MOD($A$1:$A$31,7)>1,ROW($A$1:$A$31,9^99),ROW())),"")
This formula (for Monday to Friday) needs to be called with Ctrl+Shift+Enter. After doing this for the first date, you can drag down to the bottom.
For the one with Tuesday to Saturday, it's a bit longer;
=IFERROR(INDEX($A$1:$A$31,SMALL(IF(((MOD($A$1:$A$31,7)>2)+(MOD($A$1:$A$31,7)=0))>0,ROW($A$1:$A$31),9^99),ROW())),"")
But at the same time, you have to call this function with Ctrl+Shift+Enter as otherwise, you won't be able to get the other dates (you will get #NUM! instead for the other dates).
Instead of typing the days in column A, you could do something like this:
In cell B1 is this formula (formatted as m/d/yyyy):
=TODAY()
In cell B2 is this formula (formatted as mmmm):
=DATE(YEAR(B1),MONTH(B1)-1,1)
In cell A5 is this formula (formatted as m/d/yyyy):
=IF(WEEKDAY(B2,2)<6,B2,B2+1+(WEEKDAY(B2+1,2)>5))
In cell A6 and copied down to A37 is this formula (formatted as m/d/yyyy):
=IF(NETWORKDAYS(B$2,EOMONTH(B$2,0))>COUNT(A$5:A5),A5+1+2*(WEEKDAY(A5+1,2)>5),"")
In cell B5 is this formula (formatted as m/d/yyyy):
=IF(AND(WEEKDAY(A5,2)<>{1,7}),B2,B2+1+(OR(WEEKDAY(B2+1,2)={1,7})))
Lastly, in cell B6 copied down to B37 is this formula (formatted as m/d/yyyy):
=IF(B5="","",IF(MONTH(B5+1+OR(WEEKDAY(B5+1,2)={1,7})*2)<>MONTH(B$2),"",B5+1+OR(WEEKDAY(B5+1,2)={1,7})*2))
Now the M-F and T-S dates will automatically update whenever you enter a new month. If you'd prefer to manually control it, you can just type in the date of a month in cell B1, like 8/1/2013. Then the formulas will take care of the rest and will bring in the appropriate dates from July.
You can use WORKDAY function for this:
Given that you already have 1st of the previous month in A1 put this formula in B1
=WORKDAY(A$1-1,1)
.....and this one in C1
=WORKDAY(A$1-2,1)+1
then in B2....
=IF(B1="","",IF(MONTH(WORKDAY(B1,1))=MONTH(A$1),WORKDAY(B1,1),""))
and in C2
=IF(B1="","",IF(MONTH(WORKDAY(B1-1,1)+1)=MONTH(A$1),WORKDAY(B1-1,1)+1,""))
and copy those latter two formulas down to row 23
When there are fewer than 23 MF days or TS days in the month the lowest cells will display as blanks.
If you want to exclude listed holiday dates you can also do that with WORKDAY