Excel YTD Formula?

Cactus1993
Cactus1993 used Ask the Experts™
on
Example.xlsxExample.xlsxI have a spreadsheet, attached, of my prior year monthly sales, and my current YTD monthly sales.

How do I write a formula (not an array or VBS please) to compare YTD totals through this month last year, compared to this month this year?

Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Rob HensonFinance Analyst

Commented:
Can you upload a sample file?
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
One option is to use sumifs in two locations, one for each month/year.  looks at a column of data where dates are stored in column A and amounts stored in column B.

=SUMIFS(B1:B56,A1:A56,">10/1/2017",A1:A56,"<10/31/2017")
Book1.xlsx

Author

Commented:
Sorry -- I thought I had uploaded the sample file. Here it is, attached/embedded. Thanks.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
The dates have to be automatic, by the way ... meaning for 2017 the total has to be from 01/01/2017 through 11/2/2017 (a year ago today), and for 2018 the total has to be 01/01/2018  through 11/2/2018 (today).
Ryan ChongSoftware Team Lead

Commented:
as a start, some basic formula should able to manage this

(refer to attached and see if this is what you want?)
Example_b.xlsx
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
Will all data be on one workbook in multiple sheets? Or are you trying to pull in data from multiple workbooks each with just one sheet of data?

Author

Commented:
Ryan: Thanks, but yours is a year-over-year comparison for each month. I need a YTD comparison for 2017 and 2018.  I also can't add additional helper columns to the spreadsheet.

Scott: All data will be on one worksheet. My example is a subset of data, but it will not be pulling data in from multiple workbooks. Thanks.
Rob HensonFinance Analyst

Commented:
Maybe you should update your sample file with the results that you are expecting to see with explanations against each.
In attached file, the months for 2018 (A14:A25) are changed to dates like 2017.
Then YTD can be calculated with this formula in F2
=SUMPRODUCT((YEAR($A$2:$A$25)=F$1)*(MONTH($A$2:$A$25)<=MONTH($E2))*$C$2:$C$25)

Open in new window

Last month in E2 is also found with a formula, so the values will update when you add the value for October in B23.
YTD-Example.xlsx

Author

Commented:
Perfect. That's exactly what I needed, Ejgil!  Thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial