Sum to current date only

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hi all

So Column A holds long list of dates, Column B holds sales
What would the correct formula be to sum the Sales in Column B for the previous year, only up to the same date as current year?

NDA.v2.xlsm
AB
1DATESALES
201-Feb-21
302-Feb-21830
403-Feb-21475
504-Feb-21
605-Feb-21475
706-Feb-21
807-Feb-21
908-Feb-21
1009-Feb-21
1110-Feb-21
1211-Feb-21
1312-Feb-21
1413-Feb-21
1514-Feb-21
1615-Feb-21
1716-Feb-21210
1817-Feb-21
1918-Feb-21695
2019-Feb-21
2120-Feb-21
2221-Feb-21
2322-Feb-21
2423-Feb-21350
2524-Feb-211165
2625-Feb-21
2726-Feb-21
2827-Feb-21
2928-Feb-21
3001-Mar-212650
3102-Mar-211170
3203-Mar-214575
Data (2)


I have tried something like, but I get a ZERO value

=SUMIF(Data!A2:A8000,"<="&YEAR(TODAY())-1,Data!B2:B8000)

The correct out put would be 1990 from above example as this is the total sales from 1FEB21 - 16FEB21

Thanks in advance
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi, how about :

Excel Formula:
=SUMIFS(B:B,A:A,">="&DATE(YEAR(TODAY())-1,1,1),A:A,"<="&EDATE(TODAY(),-12))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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