On the sheet I am working on, I want cells to automatically fill the numbers of the days of the month and names of the days based on what month and year is entered into two separate cells. I have this pretty much figured out with
=DAY(DATE($A9,MONTH(1&$B9),1))
and
=CHOOSE(WEEKDAY(DATE($A9,MONTH(1&$B9),DAY(DATE($A9,MONTH(1&$B9),1)))),"Sun","Mon","Tue","Wed","Thu","Fri","Sat")
But for months with fewer than 31 days, it rolls in to the next month. Instead, I want it to leave those columns beyond the end of the month blank.
This is an example of what I am talking about:
Any advice?
=DAY(DATE($A9,MONTH(1&$B9),1))
and
=CHOOSE(WEEKDAY(DATE($A9,MONTH(1&$B9),DAY(DATE($A9,MONTH(1&$B9),1)))),"Sun","Mon","Tue","Wed","Thu","Fri","Sat")
But for months with fewer than 31 days, it rolls in to the next month. Instead, I want it to leave those columns beyond the end of the month blank.
This is an example of what I am talking about:
2023 | February | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 1 | 2 | 3 |
EMPLOYEE NAME | Wed | Thu | Fri | Sat | Sun | Mon | Tue | Wed | Thu | Fri | Sat | Sun | Mon | Tue | Wed | Thu | Fri | Sat | Sun | Mon | Tue | Wed | Thu | Fri | Sat | Sun | Mon | Tue | Wed | Thu | Fri |
Any advice?