# Calculating YTD Sales

#### Greg123

##### New Member
What is an easy way to calculate YTD sales for last year for the same months that have sales this year? In the example below, I want a formula that will determine that we are 4 months into this year, and only add the first 4 months of last year so that we have a YTD comparison. In this example, the 272 is what I am looking for but I don't want to have to update the formula each month. Any help is appreciated!

 Last Year This Year January 34 45 February 21 36 March 72 45 April 145 21 May 24 June 36 July 73 August 51 September 18 October 12 November 68 December 99 TOTAL 653 147 Comparative 272 147

<tbody>
</tbody>

### 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".

#### Fluff

##### MrExcel MVP, Moderator
Hi & welcome to MrExcel.

Last edited:

#### Greg123

##### New Member
That was a little too obvious. Thanks, I should have figured that one out!

Hi & welcome to MrExcel.

Excel 2013/2016
ABC
1Last YearThis Year
2January3445
3February2136
4March7245
5April14521
6May24
7June36
8July73
9August51
10September18
11October12
12November68
13December99
14TOTAL653147
15
16Comparative272147

</tbody>
Report

Worksheet Formulas
CellFormula
B16=SUMIF(C2:C13,">0",B2:B13)

</tbody>

<tbody>
</tbody>

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Unfortunately "The obvious" very rarely is (except with hindsight)

Replies
0
Views
52
Replies
2
Views
257
Replies
0
Views
100
Replies
5
Views
147
Replies
2
Views
155

1,129,787
Messages
5,638,312
Members
417,020
Latest member
MSVII

### 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.

### Which adblocker are you using?

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

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