formula to sum the prior 12 cells regardless of added columns?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to sum the preceding 12 cells in a row within excel - regardless of
the fact that some columns will be added in front of this cell with the
formula. I want the formula to "float" just not sure how to accomplish it?
 
=SUM(INDEX(1:1,1,COLUMN()-12):INDEX(1:1,1,COLUMN()-1))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

Mopechicken said:
I need to sum the preceding 12 cells in a row within excel - regardless of
the fact that some columns will be added in front of this cell with the
formula. I want the formula to "float" just not sure how to accomplish
it?
 
the last number needs to be one MORE than the columns back
=SUM(OFFSET(G1,0,-3,1,4))
 
A bit more robust in case there aren't 12 cells before

=SUM(INDEX(1:1,1,MAX(1,COLUMN()-12)):INDEX(1:1,1,MAX(1,COLUMN()-1)))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Bob - this is perfect!
Thanks so much!!!
Not quite sure what the formula is saying - but it works perfectly!!!
 
I posted a more robust version just after, in case you start before column M
say.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top