tourless
Board Regular
- Joined
- Feb 8, 2007
- Messages
- 144
- Office Version
- 365
- Platform
- Windows
Hi Folks.
I'm working on a report that produces three datasets, week-to-date, month-to-date, and year-to-date. I can properly calculate the week start and end dates, but the MTD start date value is not claculating properly.
As an example, my cell C7 has a value of 1/6/2024 and =IF(WEEKDAY(C7)<>1, C7-WEEKDAY(C7-1), A1-WEEKDAY(C7,1)-7) correctly returns 12/21/2023 as the start date for the MTD range. If I change the value in C7 to 1/13/2024 my formula returns 1/7/2024 where it should again return 12/31/2023 as the MTD start date. I've tried a fw variations on the formula but I'm just not getting it. Can anyone help me see what I'm doign wrong?
I'm working on a report that produces three datasets, week-to-date, month-to-date, and year-to-date. I can properly calculate the week start and end dates, but the MTD start date value is not claculating properly.
As an example, my cell C7 has a value of 1/6/2024 and =IF(WEEKDAY(C7)<>1, C7-WEEKDAY(C7-1), A1-WEEKDAY(C7,1)-7) correctly returns 12/21/2023 as the start date for the MTD range. If I change the value in C7 to 1/13/2024 my formula returns 1/7/2024 where it should again return 12/31/2023 as the MTD start date. I've tried a fw variations on the formula but I'm just not getting it. Can anyone help me see what I'm doign wrong?