How to SUM between a Date Range?
How to SUM between a Date Range?
Please see the screenshot. I have a table with years associated to values. I want to separate the SUM of 'All Years' vs 'Active Years'. For example if I say my 'Active Years 'are between 2020 and 2024, how can create the formula to ignore the values with the Year 2019?
- Attachments
-
- Screen Shot 2023-09-05 at 3.02.14 PM.png (197.03 KiB) Viewed 6803 times
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to SUM between a Date Range?
Hello,
Please try to use the SumIf() function. Something like:
SumIf(datasource.column, (datecolumn >= 2020 && datecolumn <= 2024))
Thank you.
Please try to use the SumIf() function. Something like:
SumIf(datasource.column, (datecolumn >= 2020 && datecolumn <= 2024))
Thank you.
Re: How to SUM between a Date Range?
So this is the function I tried (in the Total column) and it doesn't seem to be working:
{SumIf(currentProjectRevision_ProjectRevisionFunding.Total), >=(currentProjectRevision.FiscalyearStart) && <=(currentProjectRevision.FiscalYearEnd)}
My datasource:
currentProjectRevision.FiscalyearStart = "2020"
currentProjectRevision.FiscalYearEnd = "2024"
{SumIf(currentProjectRevision_ProjectRevisionFunding.Total), >=(currentProjectRevision.FiscalyearStart) && <=(currentProjectRevision.FiscalYearEnd)}
My datasource:
currentProjectRevision.FiscalyearStart = "2020"
currentProjectRevision.FiscalYearEnd = "2024"
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to SUM between a Date Range?
Hello,
Your expression is not correct, should be:
{SumIf(currentProjectRevision_ProjectRevisionFunding.Total, (YOURDATACOLUMN >=currentProjectRevision.FiscalyearStart && YOURDATACOLUMN <= currentProjectRevision.FiscalYearEnd))}
Thank you.
Your expression is not correct, should be:
{SumIf(currentProjectRevision_ProjectRevisionFunding.Total, (YOURDATACOLUMN >=currentProjectRevision.FiscalyearStart && YOURDATACOLUMN <= currentProjectRevision.FiscalYearEnd))}
Thank you.