Day on day comparison

VbaHell

Well-known Member
Joined
Jan 30, 2011
Messages
1,220
Hello all

I hope you can help on this formula, I want to try to compare day on day sales comparison over 2018 / 2019

At the moment I have a sumifs statement that just adds up for each month and a running total for the year, it's fine for this year as it will add up to today but last year (2018) will add up the whole month and screw the full year comparison figures.

This is the formula that I use now which will add up the each month


[=SUMIFS(Sales!$I:$I,Sales!$X:$X,$B7,Sales!$E:$E,D$6,Sales!$U:$U,DashBoard!$C$4)]

I:I is the sales value
X:X is the month in Text format (Jan) or (Feb) Etc
E:E is the year in Text format (2018) or (2019)
D6 is the year (2018)
U:U is Sales people
C4 is the sales person
I also have a column with the date G:G [TABLE="width: 89"]
<colgroup><col></colgroup><tbody>[TR]
[TD]2018-01-02 which I suspect will need to be included[/TD]
[/TR]
</tbody>[/TABLE]


How can I modify this please so it only adds up to this day last year
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi VbaHell,

the formula for this day last year is: =date(year(today())-1,month(today()),day(today()) (simplified: =TODAY()-365 , but that doesn't take leap years into account).

So add another condition to your SUMIFS with column G and as a condition: "<=" & date(year(today())-1,month(today()),day(today())

See this example for some inspiration: https://basicexceltutorial.com/formula/excel-formula-to-sumif-between-two-dates

Cheers,

Koen
 
Upvote 0
Hi Koen

Thank you for your reply

Do you mean something like this please

[=SUMIFS(Sales!$I:$I,Sales!$X:$X,$B7,Sales!$E:$E,$D$6,Sales!$U:$U,$C$4,Sales!$G:$G,"<=" & date(year(today())-1,month(today()),day(today)))
 
Upvote 0
Hi VbaHell,
looks like it should work, did you try it?
Koen
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,147
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top