# Thread: Formula to sum a number of columns within a range Thanks:  2 Post #5308618 (1)Post #5308630 (1) Likes:  1 Post #5308618 (1)

1. ## Formula to sum a number of columns within a range

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?

2. ## Re: Formula to sum a number of columns within a range

Welcome to the forum.

Try:

ABCDEFGHIJKLMNO
1StartEndJanFebMarAprMayJunJulAugSepOctNovDec
226133122226
32422322223
44635352145
542
65
7

Sheet1

Worksheet Formulas
CellFormula
A4=SUM(INDEX(D2:O2,0,A2):INDEX(D100:O100,0,B2))

3. ## Re: Formula to sum a number of columns within a range

Hi, Can you use Pivot and add a filter or slicer for first 6 months

4. ## Re: Formula to sum a number of columns within a range

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.

5. ## Re: Formula to sum a number of columns within a range

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!

Glad we could help!

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•