Формула в excel сумма с шагом

0 / 0 / 0

Регистрация: 02.07.2015

Сообщений: 5

1

Суммирование ячеек с определенным шагом

08.07.2015, 08:55. Показов 7768. Ответов 3


Студворк — интернет-сервис помощи студентам

Доброе утро!

Подскажите пожалуйста на моем примере.

Из листа1 суммирую столбцы, например (C3:C16), далее (С17:C30), т.е. с определенным шагом.
Какая будет формула для облегчения счета? (лист2 D3, D4, D5, D6)

Спасибо!



0



83 / 60 / 21

Регистрация: 03.12.2014

Сообщений: 232

08.07.2015, 09:08

2

Лучший ответ Сообщение было отмечено chumich как решение

Решение

CUJLY, Доброе, сделать можно без шага суммировать с условием. смотрите файл, добавил один столбец в лист1 с датами (для условия в формуле) после добавления в нее новой даты можно ее скрывать.



1



2633 / 1333 / 255

Регистрация: 25.10.2010

Сообщений: 2,194

08.07.2015, 09:08

3

Лучший ответ Сообщение было отмечено chumich как решение

Решение

Здравствуйте.
Например, так можно

Код

=СУММ(СМЕЩ(Лист1!$C$3;(СТРОКА(A1)-1)*14;;14))



2



0 / 0 / 0

Регистрация: 02.07.2015

Сообщений: 5

08.07.2015, 09:25

 [ТС]

4

AntikBantik,
Pelena,
большое спасибо!



0



Здравствуйте!  
Как-то мне понадобилось просуммировать диапазон с шагом через две ячейки. Долго искал, были варианты, но решил написать свою функцию SumStep.    
=SumStep(диапазон, шаг_по_колонкам, шаг_по_строкам).    
Можно выделять строку, столбец, или другой массив с несколькими строками и столбцами. Просуммируются только ячейки в столбцах с шагом «шаг_по_колонкам» и строках «шаг_по_строкам». Отсчет и Суммирования начинается с первой ячейки диапазона.  
Все параметры обязательны. Если в параметрах задать нули, то будет проведено сумирование всего диапазона.  
Смотрите, пользуйтесь, а если можете упростить, или улудшить функцию — СПАСИБО.  
Вот код функции, может кому то понадобиться… )  

  Function SumStep(rg As Range, step_column As Long, step_row As Long) As Double  
Dim summa As Double  
summa = 0  
   With ActiveSheet  
       If step_row = 0 And step_column = 0 Then  
       summa = WorksheetFunction.Sum(rg)  
       End If  

             If step_row = 0 And step_column <> 0 Then  
       For x = 1 To rg.Rows.Count  
           For y = 1 To rg.Columns.Count Step step_column  
               summa = summa + rg(x, y).Value  
           Next y  
       Next x  
       End If  

             If step_row <> 0 And step_column = 0 Then  
       For x = 1 To rg.Rows.Count Step step_row  
           For y = 1 To rg.Columns.Count  
               summa = summa + rg(x, y).Value  
           Next y  
       Next x  
       End If  

             If step_row <> 0 And step_column <> 0 Then  
       For x = 1 To rg.Rows.Count Step step_row  
           For y = 1 To rg.Columns.Count Step step_column  
               summa = summa + rg(x, y).Value  
           Next y  
       Next x  
       End If  

      SumStep = summa  

         End With  
End Function

Группа: Пользователи

Ранг: Прохожий

Сообщений: 5


Репутация:

0

±

Замечаний:
0% ±


Excel 2016

Добрый день. У меня возникла следующая проблема: есть лист с почасовыми значениями, на другом листе необходимо создать таблицу с суточными значениями (то есть суммой почасовых за сутки). Первую строку я заполнила (сумма с 2 до 25 ячейки), следующая сумма должна быть с 26 по 50 ячейку, однако когда протягиваешь формулу, получается сумма с 3 по 26 ячейку. Как сделать сумму через 24 ячейки?

Для примера прикрепила файл с 5 днями, всего дней больше 700, и вручную сумму посчитать нереально.

К сообщению приложен файл:

2119877.xlsx
(15.1 Kb)

Сообщение отредактировал alenzagolЧетверг, 07.06.2018, 13:59

Excel для Microsoft 365 Excel для Microsoft 365 для Mac Excel для Интернета Excel 2021 Excel 2021 для Mac Excel 2019 Excel 2019 для Mac Excel 2016 Excel 2016 для Mac Excel 2013 Excel 2010 Excel 2007 Excel для Mac 2011 Excel Starter 2010 Еще…Меньше

В этой статье описаны синтаксис формулы и использование функции РЯД.СУММ в Microsoft Excel.

Описание

Многие функции могут быть аппроксимированы разложениями в степенные ряды.

Возвращает сумму степенного ряда, вычисленную по формуле:

Уравнение

Синтаксис

РЯД.СУММ(x; n; m;коэффициенты)

Аргументы функции РЯД.СУММ описаны ниже.

  • X    Обязательный. Значение переменной степенного ряда.

  • n    Обязательный. Показатель степени x для первого члена степенного ряда.

  • m    Обязательный. Шаг, на который увеличивается показатель степени n для каждого следующего члена степенного ряда.

  • Коэффициенты    Обязательный. Набор коэффициентов при соответствующих степенях x. Количеством значений в аргументе «коэффициенты» определяется количество членов степенного ряда. Например, если в аргументе «коэффициенты» три значения, то степенной ряд содержит три слагаемых.

Замечание

Если какой-либо из аргументов не является числом, возвращается #VALUE! значение ошибки #ЗНАЧ!.

Пример

Скопируйте образец данных из следующей таблицы и вставьте их в ячейку A1 нового листа Excel. Чтобы отобразить результаты формул, выделите их и нажмите клавишу F2, а затем — клавишу ВВОД. При необходимости измените ширину столбцов, чтобы видеть все данные.

Данные

Коэффициенты в виде чисел

Коэффициенты в виде формулы

0,785398163

=ПИ()/4

1

1

-0,5

=-1/ФАКТР(2)

0,041666667

=1/ФАКТР(4)

-0,001388889

=-1/ФАКТР(6)

Формула

Описание (результат)

Результат

=РЯД.СУММ(A3;0,2;A4:A7)

Аппроксимация косинуса ПИ/4 радиан или 45 градусов (0,707103)

0,707103

Нужна дополнительная помощь?

If your Excel worksheet includes calculations that are based on a changing range of cells, use the SUM and OFFSET functions together in a SUM OFFSET formula to simplify the task of keeping the calculations up to date.

Instructions in this article apply to Excel for Microsoft 365, Excel 2019, Excel 2016, Excel 2013, and Excel 2010.

Create a Dynamic Range With the SUM and OFFSET Functions

If you use calculations for a period of time that continually changes — such as determining sales for the month — use the OFFSET function in Excel to set up a dynamic range that changes as each day’s sales figures are added.

By itself, the SUM function can usually accommodate the insertion of new cells of data into the range being summed. One exception occurs when the data is inserted into the cell where the function is currently located.

In the example below, the new sales figures for each day are added at the bottom of the list, forcing the total to continually shift down one cell each time as the new data is added.

To follow along with this tutorial, open a blank Excel worksheet and enter the sample data. Your worksheet doesn’t need to be formatted like the example, but be sure to enter the data in the same cells.

If only the SUM function is used to total the data, the range of cells used as the function argument would need to be modified each time new data is added.

By using the SUM and OFFSET functions together, the range that is totaled becomes dynamic and changes to accommodate new cells of data. The addition of new cells of data does not cause problems because the range continues to adjust as each new cell is added.

Syntax and Arguments

In this formula, the SUM function is used to total the range of data supplied as the argument. The start point for this range is static and is identified as the cell reference to the first number to be totaled by the formula.

The OFFSET function is nested inside the SUM function and creates a dynamic endpoint to the range of data totaled by the formula. This is accomplished by setting the endpoint of the range to one cell above the location of the formula.

The formula syntax is:

=SUM(Range Start:OFFSET(Reference,Rows,Cols))

The arguments are:

  • Range Start: The starting point for the range of cells that will be totaled by the SUM function. In this example, the starting point is cell B2.
  • Reference: The required cell reference used to calculate the range endpoint. In the example, the Reference argument is the cell reference for the formula because the range ends one cell above the formula.
  • Rows: The number of rows above or below the Reference argument used in calculating the offset is required. This value can be positive, negative, or set to zero. If the offset location is above the Reference argument, the value is negative. If the offset is below, the Rows argument is positive. If the offset is located in the same row, the argument is zero. In this example, the offset begins one row above the Reference argument, so the value for the argument is negative one (-1).
  • Cols: The number of columns to the left or right of the Reference argument used to calculate the offset. This value can be positive, negative, or set to zero. If the offset location is to the left of the Reference argument, this value is negative. If the offset is to right, the Cols argument is positive. In this example, the data being totaled is in the same column as the formula, so the value for this argument is zero.

Use the SUM OFFSET Formula to Total Sales Data

This example uses a SUM OFFSET formula to return the total for the daily sales figures listed in column B of the worksheet. Initially, the formula was entered into cell B6 and totaled the sales data for four days.

The next step is to move the SUM OFFSET formula down one row to make room for the fifth day’s sales total. This is accomplished by inserting a new row 6, which moves the formula to row 7.

As a result of the move, Excel automatically updates the Reference argument to cell B7 and adds cell B6 to the range summed by the formula.

  1. Select cell B6, which is the location where the formula results will initially display.

  2. Select the Formulas tab of the ribbon.

  3. Choose Math & Trig.

  4. Select SUM.

  5. In the Function Arguments dialog box, place the cursor in the Number1 text box.

  6. In the worksheet, select cell B2 to enter this cell reference in the dialog box. This location is the static endpoint for the formula.

  7. In the Function Arguments dialog box, place the cursor in the Number2 text box.

  8. Enter OFFSET(B6,-1,0). This OFFSET function forms the dynamic endpoint for the formula.

  9. Select OK to complete the function and close the dialog box. The total appears in cell B6.

Add the Next Day’s Sales Data

To add the next day’s sales data:

  1. Right-click the row header for row 6.

  2. Select Insert to insert a new row into the worksheet. The SUM OFFSET formula moves down one row to cell B7 and row 6 is now empty.

  3. Select cell A6 and enter the number 5 to indicate that the sales total for the fifth day is being entered.

  4. Select cell B6, enter $1458.25, then press Enter.

  5.  Cell B7 updates to the new total of $7137.40.

When you select cell B7, the updated formula appears in the formula bar.

=SUM(B2:OFFSET(B7,-1,0))

The OFFSET function has two optional arguments: Height and Width, which were not used in this example. These arguments tell the OFFSET function the shape of the output in terms of the number of rows and columns.

By omitting these arguments, the function uses the height and width of the Reference argument instead, which, in this example is one row high and one column wide.

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Subscribe

Понравилась статья? Поделить с друзьями:
  • Формула в excel сумма произведений двух столбцов
  • Формула в excel сумма при фильтре
  • Формула в excel сумма при двух условиях
  • Формула в excel сумма по определенным ячейкам
  • Формула в excel сумма по датам