Summing prior 12/6 columns including current one - LTM

Buzby

New Member
Joined
Feb 22, 2025
Messages
8
Office Version
  1. 365
Hi all,

Id like to put in a formula where i can sum up the prior 6 months based on a date - so here its 2023 May so id want to sum up 2022 Dec up to May 23. This will change each month so i wanted to avoid changing my sum each time and would rather something like a let function. Can anyone advise?

Last 6 months Based on 2023 May
2022 Dec 2023 Jan 2023 Feb 2023 Mar 2023 Apr 2023 May
2,022 2023 2023 2023 2023 2023
December January February March April May
Apples 16,000 16,000 15,000
Pears 113,255 113,255 109,014 96,421 26,923
Mandarin 66,594 66,594 31,686 24,000
 
if you use a date in your headings then you can use
SUM and filter

=SUM(FILTER(B6:F8,B5:F5>=DATE(YEAR(B2),MONTH(B2)-6,DAY(B2))))

so it only picks april and may from the headers in row 5 and then sums those columns in B6 to F8 - son only E and F columns

which is 147,344

But i'm really not sure / understand of your layout

you can reformat the dates to show hoever you like

here i have showed oct as the required month and going back 6 months

Book1
ABCDEFGH
1
2Last 6 months1-Oct-23
32022 Dec2023 Jan2023 Feb2023 Mar2023 Apr2023 May
42,02220232023202320232023147344
51-Dec-221/1/232/1/233/1/234/1/235/1/23
6Apples16,00016,00015,000
7Pears113,255113,255109,01496,42126,923
8Mandarin66,59466,59431,68624,000
Sheet3
Cell Formulas
RangeFormula
H4H4=SUM(FILTER(B6:F8,B5:F5>=DATE(YEAR(B2),MONTH(B2)-6,DAY(B2))))



Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0

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