Formula to sum a number of columns within a range

millylopez04

New Member
Joined
Jul 12, 2019
Messages
3
Hello!

I'm trying to come up with a way to sum a certain number of columns within a range. I have 12 columns (Jan-Dec) with data in them, but I want to sum only from like Jan-Jun without having to update all the formulas all the time, I think I should be able to have a formula with the entire range of columns but only returning the the number of columns I need every month. I think by adding this number in a separate cell like 6 for June or something like that.

How would I go about creating this formula?

Thanks in advance!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to the forum.

Try:


Book1
ABCDEFGHIJKLMNO
1StartEndJanFebMarAprMayJunJulAugSepOctNovDec
226133122226
32422322223
44635352145
542
65
7
Sheet1
Cell Formulas
RangeFormula
A4=SUM(INDEX(D2:O2,0,A2):INDEX(D100:O100,0,B2))
 
Upvote 0
This works, I just changed the second Index range to be within the same row since I need a total for each row (each account).

Thanks a lot for your help!

This is awesome.
 
Upvote 0
If it's within the same row, there's a shorter formula you can use involving OFFSET. But I'd recommend sticking with the current formula because it's pretty easy to see how to adapt it for other cases, as you've seen! :LOL:

Glad we could help!
 
Upvote 0

Forum statistics

Threads
1,213,507
Messages
6,114,029
Members
448,543
Latest member
MartinLarkin

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