jessebh2003
Board Regular
- Joined
- Feb 28, 2020
- Messages
- 71
- Office Version
- 365
- Platform
- Windows
In my spreadsheet, I have many formulas that either count or average given a date range. Everything works great except for February.
I've named some of my cells to make the formula easier for me to read.
Is there a way to automatically update the 28 to a 29 if the year is a leap year or a another way to write the formulas? Appreciate any help or suggestions! Thanks.
Excel Formula:
=IFERROR(COUNTIFS(Table13[PhysicianType],"*"&$D$9&"*",Table13[SubmissionDate],">="&DATE(Year,Feb,1),Table13[SubmissionDate],"<="&DATE(Year,Feb,28)),0)
Excel Formula:
=IFERROR(AVERAGEIFS(Table13[TheContentWasRelevantToMyWork],Table13[SubmissionDate],">="&DATE(Year,Feb,1),Table13[SubmissionDate],"<="&DATE(Year,Feb,28)),0)
I've named some of my cells to make the formula easier for me to read.
- Year - E1, which is a drop down for the year
- Jan - E2, Feb - G2, Mar - I2, etc.
Is there a way to automatically update the 28 to a 29 if the year is a leap year or a another way to write the formulas? Appreciate any help or suggestions! Thanks.