15,732 questions
2
votes
0
answers
107
views
Infinite sum involving a parameter
How do I persuade SymPy to evaluate an infinite sum which converges and I know SymPy should be able to do? For example, the following just gives back the unevaluated infinite sum:
a = Symbol('a',real=...
Best practices
1
vote
8
replies
136
views
How to count how many consecutive days I had over an specific temperature? (in R)
I have created an indicator "hd" (heat day) when the temperature is over the 90th percentile of the distribution, and then I repeated the same instruction for a counter number of days (cd).
...
-2
votes
1
answer
56
views
Split Entry into Multiple Rows Based on Cell Value [duplicate]
I am recording data of fertilizers and pesticides of a farm. The farm is divided into many areas about 40.
In each entry it is supposed to include the amount given to each area from 1 to 40.
Most of ...
0
votes
0
answers
30
views
How to conditionally sum values after deduplication per minute in Apache IoTDB?
I am using Apache IoTDB 2.0.6 (table model). Due to unstable device reporting, multiple data points may appear within the same minute. However, for business statistics, I need to aggregate data at the ...
1
vote
0
answers
85
views
Latency of warp add reduction instruction
The CUDA Programming Guide describe a warp instruction named __reduce_add_sync.
What is the latency of the function, specifically in the Ampere architecture?
Related sources:
This table within the ...
0
votes
1
answer
147
views
Compare the sum of two different values group by another column (distinct), and group by of "opposite" value [closed]
I'm trying to write a query to find "matching" data from two different fields within the same table.
For example, a table has a client column, amount charged column and location column. I ...
1
vote
1
answer
71
views
google sheets SUMIF based on other sheet
I have a sheet contains info like this:
Date (A)
Sub (B)
Total (C)
1/20/2026
100
106
12/15/2025
50
60
2/1/2026
25
30
on another sheet, I want to show summed rows by year...for example
year
sub
total
...
0
votes
3
answers
165
views
Sum of total value for all dates separately in excel based on values from a table
I'm trying to get a report sheet based on another table that contains more data
i have succeeded in creating the date column based on the available dates in the other table using =UNIQUE(FILTER(...
1
vote
0
answers
176
views
As part of a function, how could I create a variable number of sums one inside another based on a parameter?
I'm currently struggling on an assignment (probability class) which require creating a function (VBA excel) that contains a variable number of sums one inside the other based on a parameter. I'm not ...
0
votes
1
answer
49
views
Totals from specific parts of a large spreadsheet by row and column
Here is a large spreadsheet with several years' worth of data in a lot of categories.
Y = year, M = month, D = day
A B C D E
1| Y | M | D | 1 | 2 |... Initial dataset
2| 19 | 1 | 1 | ...
0
votes
2
answers
121
views
How create a dynamic cumulative sum in power query
I want to create a sum in power query (Measure C below) returns the cumulative sum of Measure A + Measure B and is limited to zero and which resets at the beginning of each Period as shown in the ...
2
votes
1
answer
225
views
How to filter and sum elements of a matrix in MATLAB based on multiple conditions without a loop?
I have the following numeric matrix in MATLAB:
A = [3 2 7; 9 1 4; 5 6 8];
I want to sum all elements that are greater than 5 and are also even.
I need to do this without using a loop, and store the ...
0
votes
0
answers
63
views
Sum of integer data and numeric data is unexpected numeric value, R [duplicate]
Why is the sum of the iaea_mass_dat_trunc$AM_WN (integer) and iaea_mass_dat_trunc$AM_frac (numeric) 499496.6 for all results? How do I get the appropriate result (for example, the sum of the values in ...
0
votes
1
answer
130
views
Python lambda returns 0 [closed]
Is there a simple way to return 0 with a lambda function using and and or operators?
For example, consider this function to sum elements in an array:
sum = lambda tab: tab == [] and 0 or tab[0] + sum(...
2
votes
3
answers
142
views
Query count & sum nested selects into a Grouped Category
My current project/issue is we have a list of permit types. With these types they are needing to be grouped by an overall category. Once grouped out the end goal is to count how many within specified ...
0
votes
2
answers
79
views
SAS: Conditionally summing a column without having the lead funtion
I cannot conditionally sum a column where the condition looks at rows further down the table. Below is what I am expecting:
Identifier
MONTH
Sum_Me_Pls
On_Off_Flag
focus
seq
Need
1
May-23
0
0
0
1
1
...
0
votes
1
answer
154
views
How to sum two columns and calculate their average in BigQuery?
I'm working with Google BigQuery and I have a table with two numeric columns: grade1 and grade2. I want to calculate the total sum of both columns combined (row-wise) and then find the average of ...
2
votes
1
answer
81
views
Is there a more elegant way to write sum in MATLAB code
disto_pow = spectral_pow(h_idx * 2) + spectral_pow(h_idx * 3) + spectral_pow(h_idx * 4) + spectral_pow(h_idx * 5) + spectral_pow(h_idx * 6);
spectral_pow is an array and h_idx is a scalar.
Is there a ...
0
votes
1
answer
149
views
NEW QUESTION: How do I use SUMIFS with IMPORT RANGE in google sheets to sum a column based on referenced criteria (ex: "<="$K$5)?
UPDATED EDITS BELOW
I have a list of downloaded transactions that each correspond to a specific account code? I want to sum the amount (column G) based on the following criteria: segment (column A), ...
0
votes
0
answers
31
views
Sum of vlookups with a partial match: What is the formula, if it exists?
I'm trying to see if this is even possible. I am essentially trying to get a partial match vlookup with the added component of possibly a sumifs formula to get the total amount of pay for each store.
...
2
votes
3
answers
156
views
Double aggregation function
I have the result of a subquery:
SELECT
maker, p.type, COUNT(DISTINCT pc.model) pcs
FROM
Product p
INNER JOIN
Pc pc ON p.model = pc.model
GROUP BY
maker, p.type
UNION
SELECT
...
-4
votes
1
answer
85
views
Summing numbers in Kotlin [closed]
fun main() {
var numbers =("1,2,3,4,5,6")
val result = numbers . sum ()
println ("$result ")
}
I wanted to calculate these numbers with the sum function, but it ...
0
votes
1
answer
118
views
Why is SQL SUM function returning wrong values using SqLite3 and Dbeaver
I have been taking a SQL course and am in the final project, which started to use SQLite3 on DBeaver. Previously the SQL prompts were written in the course using SQLite.
When trying the aggergate ...
2
votes
2
answers
88
views
Exclude column in sapply(dat_clean, FUN = function(x){x / sum(x)}) in R
I'm working on a piece of R code to calculate the diversity in a dataset of fungal taxonomies. The tutorial I'm following has a piece of code meant to sum each row, which isn't working because the ...
1
vote
2
answers
111
views
Excel spillrange with sum
SUM(FILTER(Tbl_Assets[WDV on Year 0],(Tbl_Assets[Asset Group as per Co. Act (SCH II)]=Q14)*((Tbl_Assets[Disposal Date]>StartDate)+(Tbl_Assets[Disposal Date]=0)),0))
In the above formula, if I try ...
1
vote
1
answer
73
views
Combining Sum with Vlookup
I have this data (table 1) :
Column A
1999
5000
6666
And there's table 2 :
Col.C | Col.D (range)| Col.E (margin)
1000 | 1000 - 1260 | 830
1261 | 1261 - 1261 | 0
1262 | 1262 - 1513 | 830
...
0
votes
0
answers
37
views
Python Pandas, groupby and sum over another column [duplicate]
I have one dataframe with columns A, B, C, D, E. I would like to groupby over columns A and B, and, for each value of E, perform a sum over C and D. Something like:
for each e in E:
df[E == e]....
-1
votes
3
answers
108
views
Sum of multiple datatable columns
I want to get the sum of only two columns for each data row in datable and display it in datagridView. I tried to use link query:
SqlCommand cmd = new SqlCommand("SELECT * FROM Student", con)...
0
votes
1
answer
129
views
Why can't SymPy calculate the Sum(1 / ((k + 1) ** 4 + 1), (k,-oo,oo)) when it appears to converge?
I'm using Sympy for some numeric calculations, specifically for infinite summations. The following code returns 0:
import sympy as sp
from sympy.abc import k
sp.summation(1 / ((k + 1) ** 4 + 1), (k, -...
1
vote
1
answer
47
views
shell script to sum numbers
I have the following data:
KEY v2025.10: user1 0/2 at 03/06 14:00 (handle: e01)
KEY v2025.10: user1 1/2 at 03/06 14:01 (handle: f01)
KEY v2025.10: user2 0/1 at 03/06 14:01 (handle: 1001)
KEY v2025....
1
vote
5
answers
145
views
How do I sum up each month for all 12 months in one query
The query I work with works with YEAR and MONTH to get one SUM for each date:
EKA = CONVERT(DECIMAL(10,0),
(SELECT ISNULL(SUM(LP.QTY), 0)
FROM Invoice LP
WHERE LP.ARTICLE = A.ARTICLE
...
1
vote
2
answers
94
views
SQL Server sum over partition by
I have a fact table and I am using sum over partition by on the column vacant. I want to sum vacant when vacant is above 0. I have the following query:
SELECT
f.[D_Building_Id],
f.[...
0
votes
1
answer
93
views
How to count number of tabs containing a word - VBA
I'm trying to figure out how to check which tabs contain a certain word and to count these instances.
I have it set up currently that when a "client" is lost, their data tab is renamed to ...
0
votes
0
answers
53
views
Why does PHP sum values of similar array items differently? [duplicate]
Laravel 8 , php 8
I saw a very strange thing in Laravel and actually in PHP that I can't understand why this is happening in PHP.
I have two arrays that are almost identical and have only one very ...
2
votes
1
answer
106
views
How to perform row aggregation across the largest x columns in a polars data frame?
I have a data frame with 6 value columns and I want to sum the largest 3 of them. I also want to create an ID matrix to identify which columns were included in the sum.
So the initial data frame may ...
-2
votes
4
answers
364
views
How to sum up to a specific value in Google Sheets
I have a complicated situation in Google Sheets and I don't know if it there is a possible solution for this in sheets. I have a list of records with various values both positive and negative, the ...
0
votes
2
answers
106
views
For loop in R to assign a vector where each element is the sum of a data set's column. First element of vector = sum of first column
Really new to R and not sure if i'm grabbing the correct column. Im using for loop to read each column 1 by 1 but when I print totals im just getting how many columns there are
setwd("~/Desktop&...
1
vote
1
answer
99
views
Count in specific ways in Google sheets
I am working on getting some specific counts but cannot figure out how to do it.
I have the following sheet:
Duration for subject 1 is 30 min and 90 min for subject 3
Subject 1
Subject 1
Subject 1
...
0
votes
1
answer
86
views
Error in "across( )" when summing multiple columns in R
Using the following data:
Distance <- data.frame(
DAY = c("1", "2","3")
,TEMP = c(25, 27, 26.5)
,C1Dist01 = c(1, 1, 1)
,C2Dist01 = c(1, 1, 0)
,C3Dist01 =...
2
votes
3
answers
116
views
how to sum cells/ struct in matlab
I am trying to add vertically the lists of a database like DB (see below) contained in a cell.
DB={ {[11 12]} {[13 14]} {[15 16]} {[17 18]} {[19 20]};
{[21 22]} {[23 24]} {[25 26]} {[27 28]} {[...
-3
votes
1
answer
69
views
Sum based on a criterion
I have a data sheet where I want to do a calculation until I find a zero in one specific column. Then I want to sum all the results of this calculation up to that zero and save the result in an array. ...
0
votes
2
answers
106
views
Calculating a value by summing several rows
Table contains data about hotel rooms.
We can see the same Room available for different date periods - at different Prices. AccmdMenTypeCode - is the Code that shows how many people can stay in this ...
1
vote
2
answers
142
views
Spill formula to sumifs by row & col for only relevant months
I have a loosely formatted table that has People going across the top, tasks going down the rows, and a column for start date and column for End Date. The user will input expected hours in the given ...
0
votes
2
answers
44
views
Sum up and Convert a Dataframe
I hope someone can help me with the following problem.
My dataframe is organized with insect species in the columns and locations in the rows like:
Species A
Species B
Species C
Location A
0
1
...
0
votes
0
answers
29
views
Combination of ffil and sum in Pandas dataframe [duplicate]
I am stuck with the following problem and would greatly appreciate much help. I have a dataframe as follows:
df = pd.DataFrame({'id': [1,1,1,1,1,1,1,2,2,2],
'date':['31.01.2012', '...
0
votes
2
answers
131
views
Auto Insert row and insert Total and sum using Excel VBA
I want to insert total in the rows based on the Serial Number in Row A starting from Row 6. There are more than 5000 rows in a sheet.
When there are two serial numbers like in this example A15 and A16,...
0
votes
1
answer
96
views
Unable to Change Comma to a Dot in Decimals in R [closed]
I have a .csv file that I’m having trouble processing because the numbers use commas for decimals, which causes issues when reading the file in R. Excel interprets commas for decimals, while R uses ...
3
votes
3
answers
93
views
Sum row values when first column data is equal
How to sum data in 2nd column for same values in column 1:
c = [11 1;
11 3;
12 5;
13 9;
13 11;
13 3]
expected result is:
r = [11 4;
12 5;
13 23]
I know how to ...
0
votes
3
answers
103
views
Need to have excel average every nth row only with data in it
I have a weekly scorecard that our leadership is going to fill out. Its all on one tab and has 500+ rows of the same scorecard that runs with the same statistics. I took a screen grab of one section. ...
-2
votes
4
answers
201
views
How to iterate multidimensional array data and sum some values to return a grouped array
What's the simplest way and uses less computing power to check if a multidimensional array has some equal values in the sub keys and, if is in this way, make the sum of that?
Look at the input. It's ...