I'm in need of some formula assistance in Excel. I'm trying to use the dates in columns G and H (period start date and period end date) to automatically fill out the matrix on the right (columns O through Z) as I have currently manually completed it. For example, if a period starts on 1/1/20 (cell G5) and ends on 6/30/20 (cell H5), I need cells O5:Z5 to show 1, 2, 3, 4, 5, 6, null, null, null, null, null, null. If the period starts on 10/1/20 and ends on 3/31/21, then the cells in O5:Z5 would show null, null, null, null, null, null, null, null, null, 10, 11, 12.
Any help is much appreciated!! Thank you!
I've tried several IF(AND and IF(OR formulas using date references. I've been able to get most of the rows to populate using the following formula, but the problem is the rows with dates that span two years (ex: row 14, which spans 2020 and 2021).
=IF(AND(MONTH(O$4)>=MONTH($G5),MONTH(O$4)<=MONTH($H5)),1,IF(AND(MONTH(O$4)>=MONTH($G5),MONTH($H5)<=12),1,""))