If you type "03/2028" into A1, Excel interprets it as a date and you'll see 02/01/2028 in the formula bar, but it will display differently in the cell itself. On my machine I would see Mar-2028, so I formatted the cell as custom: mm/yyyy.
in D2 entering the formula =A1, puts the date in A1 in D2. D2 is formatted as d to display just the day number of the month in the cell.
In E2, I wanted to just add 1 to the previous day's date but I also have to check to see if that results in going over to the next month: does MONTH(D$2+1)=MONTH($A$1)? If the month is the same then get the column number (for example, for the formula in E2, the column is 5 so I subtracted 4 and added the 1 remainder to the date in A1 to get the second day. However, if the months are not the same as when going from the last day of February to March, the cell is left as blank. So the to catch the error in the cell which would have Feb 31st I used the IFERROR to show it as blank also.
Note that the values in D1:AH2 are Excel dates formatted just to show the day of the month. So, the values in row 3 are those same dates but formatted to show the day names only.
Bookmarks