Calculate TY/LY comp by aggregate daily sales

jmuffintop

New Member
Joined
Jun 20, 2018
Messages
1
I am trying to calculate a live sales comp for 2017/2018.

In order to do the basic comp calculation, I need to sum 2017 sales up to the last corresponding sales input line for 2018. In this example it would be 2000. If I entered sales for 6/4/2018, the new aggregate sum for 2017 would be 2500. Any idea how to accomplish this?


DayDateSalesDayDateSales
Thurs
6/1/2017500Thurs5/31/2018700
Fri6/2/2017500Fri6/1/2018700
Sat6/3/2017500Sat6/2/2018700
Sun6/4/2017500Sun6/3/2018700
Mon6/5/2017500Mon6/4/2018-
Tues6/6/2017500Tues6/5/2018-
Weds6/7/2017500Weds6/6/2018-
Thurs6/8/2017500Thurs6/7/2018-
Fri6/9/2017500Fri6/8/2018-

<tbody>
</tbody>
-
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Assuming your table starts in A1. Enter a helper field in cell I1 which determines the earliest date in the 2018 table which doesn't have an associated value:

I1: {=MIN(IF(G2:G10=0,F2:F10))} This is an array formula so use CTRL-SHIFT-ENTER when entering the formula

The formula for the aggregate sum is then:

=SUMIF(B2:B10,"<="&EDATE(I1,-12),C2:C10)
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

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