ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   sumif for a specific number of cells (https://www.excelbanter.com/excel-discussion-misc-queries/217127-sumif-specific-number-cells.html)

simon1982

sumif for a specific number of cells
 
I have a 52 columns, one for each week of the year. Each column has 10 rows
of data. I need a totals line which, for each row, sums 13 columns (13 weeks)
but the 13 colums it sums needs to be changable ie sum weeks 1-13 or 14-27 or
32-35 etc. Any idea how I make this formula driven - my thoughts were to use
a sumif formula and input the criteria to sum the numbers between week 14 and
27 (taking 14 and 27 from an input in another cell).

Any ideas on how I solve this? Thanks. Simon

Pete_UK

sumif for a specific number of cells
 
At the bottom of the 13th column (M?), put this formula:

=SUM(A2:M11)

Then just copy it across.

Hope this helps.

Pete

On Jan 20, 2:19*pm, simon1982
wrote:
I have a 52 columns, one for each week of the year. Each column has 10 rows
of data. I need a totals line which, for each row, sums 13 columns (13 weeks)
but the 13 colums it sums needs to be changable ie sum weeks 1-13 or 14-27 or
32-35 etc. Any idea how I make this formula driven - my thoughts were to use
a sumif formula and input the criteria to sum the numbers between week 14 and
27 (taking 14 and 27 from an input in another cell).

Any ideas on how I solve this? Thanks. Simon



Pete_UK

sumif for a specific number of cells
 
I think I misread your requirements. You want a total on each row,
which covers 13 columns (which can be variable)?

Assuming your data occupies A2:AZ11, then put 1 in BA1 and this
formula in BA2:

=SUM(INDIRECT("RC"&BA$1&":RC"&BA$1+12,0))

Copy this down to BA11. It will sum up 13 columns for each row,
starting with the column number in BA1 - just change this value for a
different 13 columns (max 40).

Hope this helps.

Pete

On Jan 20, 2:44*pm, Pete_UK wrote:
At the bottom of the 13th column (M?), put this formula:

=SUM(A2:M11)

Then just copy it across.

Hope this helps.

Pete

On Jan 20, 2:19*pm, simon1982
wrote:



I have a 52 columns, one for each week of the year. Each column has 10 rows
of data. I need a totals line which, for each row, sums 13 columns (13 weeks)
but the 13 colums it sums needs to be changable ie sum weeks 1-13 or 14-27 or
32-35 etc. Any idea how I make this formula driven - my thoughts were to use
a sumif formula and input the criteria to sum the numbers between week 14 and
27 (taking 14 and 27 from an input in another cell).


Any ideas on how I solve this? Thanks. Simon- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 06:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com