formula to give me year to date up to end of last month?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,212
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

Ok so I have a problem,

I need to calculate last year year to date figure.

I have the data set out in columns

[TABLE="width: 190"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: right"]March 2018[/TD]
[TD],G[/TD]
[/TR]
[TR]
[TD="align: right"]April 2018[/TD]
[TD],J[/TD]
[/TR]
[TR]
[TD="align: right"]May 2018,[/TD]
[TD]M[/TD]
[/TR]
[TR]
[TD="align: right"]June 2018[/TD]
[TD],P[/TD]
[/TR]
[TR]
[TD="align: right"]July 2018[/TD]
[TD],S[/TD]
[/TR]
[TR]
[TD="align: right"]August 2018[/TD]
[TD],V[/TD]
[/TR]
[TR]
[TD="align: right"]September 2018,[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD="align: right"]October 2018[/TD]
[TD],AB[/TD]
[/TR]
[TR]
[TD="align: right"]November 2018[/TD]
[TD],AE[/TD]
[/TR]
[TR]
[TD="align: right"]December 2018,[/TD]
[TD]AH[/TD]
[/TR]
[TR]
[TD="align: right"]January 2019,[/TD]
[TD]AK[/TD]
[/TR]
[TR]
[TD="align: right"]February 2019,[/TD]
[TD]AN[/TD]
[/TR]
</tbody>[/TABLE]
Now what I need is a formula that can only add up the months we are past, automaticly changing when we go into a new month.

So If I was in October 2018 I would want from March to September so I need to add up G+J+M+P+S+V+Y and the row i'm on?

any ideas how to do this?

Thanks

Tony
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Assuming that you have excel dates in row 1 and is the first of the month and that the columns in between are blank or non numeric.
Code:
=SUM(G2:INDEX(G2:AN2,MATCH(EOMONTH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),-2)+1,G1:AN1,0)))
 
Upvote 0

Forum statistics

Threads
1,226,112
Messages
6,189,041
Members
453,521
Latest member
Chris_Hed

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