5,856 questions
2
votes
1
answer
80
views
Average First n Columns with Values Even if Not Enough Values
I am trying to average only the first n values of a row but am getting an error if I don't have enough cells with values.
How do I have the equation only look at the first 4 cells with values?
I've ...
2
votes
3
answers
116
views
How do I limit an array to a single column in VBA?
I have this code for "Data 1" that I got from an AI ChatBot. I want it to average my values in column B based on if there are duplicate values in column D, and it does this. But now I want ...
2
votes
3
answers
109
views
VBA how to average data and then identify if data is averaged or not? [closed]
Please see input and output data in the image. The input table is multiple rows of data from the same subject but different timepoints. There are sometimes multiple data entries for the same subject ...
6
votes
4
answers
357
views
How do you figure out how large an integer you will need for an operation in embedded systems?
For example, if I want to add two unsigned 8-bit integers together, I know I will need to store the result in a 16-bit integer. Otherwise, I run the risk of overflowing.
This problem gets more ...
0
votes
1
answer
138
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
3
answers
104
views
Adding raster bricks based on their respective dates in R terra
I need to average two raster stacks which containing daily temperature data shifted by 2 days.
First stack times: "2020-05-01 00:00:00 UTC", "2020-05-02 00:00:00 UTC", "2020-...
0
votes
1
answer
87
views
Why does this SQL code not correctly calculate the price of an item plus the average of all items as a new variable without using SET?
I am solving the following problem:
As the manager of a scooter shop, you have noticed that many scooters are not original, meaning they are missing a model name. Furthermore, bad scooters typically ...
0
votes
0
answers
53
views
Average aggregation of data stream in bytewax
I want to aggregate the values of my DataStream in tumbling windows of 10 seconds.
Unfortunately is the documentation in Bytewax very limited and I also don't find any other source where an average of ...
3
votes
5
answers
118
views
Averaging temporal series with fixed resolution in R
I have a number of chromatograms saved as .csv files in a folder that look something like
time <- c(0.001575, 0.008775, 0.015975, 0.023175, 0.030375, 0.037575, 0.044775, 0.051975, 0.059175, 0....
0
votes
4
answers
74
views
Is there a way to sort based on average of multiple columns, ignoring NULL?
I have a table that I want to sort based on the average of 3 columns. For example:
select * from table order by ((col1+col2+col3)/3);
HOWEVER, if any of the three columns are null, then the null ...
0
votes
1
answer
59
views
AVG function returns only 1 or 0, Apache Hive
Imagine I have a table with purchases, where I see id of customer, id of store where he bought something (I see other cols like prices, dates and others but not that important now). I have second ...
1
vote
3
answers
158
views
How to calculate average sales per weekday using Google Sheets?
I have two columns, date and net sales. My goal is to get the average sales for Monday
I am trying the following formula:
=AVERAGEIF(WEEKDAY(A2:A),2,B2:B)
Explanation of attempt:
WEEKDAY(A2:A) is ...
-1
votes
2
answers
124
views
Dateadd for moving 7 day avg VS (partition by price order by date rows between 6 preceding and current row)
Will the statement
Select productid, avg(price) as avgPrice, date as salesDate
from sales
where date between getdate() and dateadd(day, -7, getdate)
group by date
return the same results as
select ...
0
votes
1
answer
85
views
Group average as a baseline & individual variance to baseline
Description of issue: I am trying to get a table to show the average of select individual's averages, where the individuals are in a specific group. That group is controlled by a slicer or filter. AND....
0
votes
2
answers
69
views
Can't manage to make multiple averages with SQL [duplicate]
I've been trying to see the average salary of each profession of a hospital (this is an exercise BTW) but I can't manage to make an average for each service separately.
My last and what I believe is ...
8
votes
4
answers
458
views
How do I calculate the averages of values per date and category and display them lagged?
I have a table with non-consecutive dates, a categorical variable and a variable (price). I want the average price per category per day. But where it gets tricky is I want that average price to be the ...
1
vote
2
answers
155
views
How to get maximum average of subarray?
I have been working this leet code questions
https://leetcode.com/problems/maximum-average-subarray-i/description/
I have been able to create a solution after understanding the sliding window ...
0
votes
2
answers
98
views
Using average, offset & match together
I'm creating a fitness tracker with daily inputs & a weekly summary on a dashboard. My daily input data looks like this:
Date
Miles
Intake
01-Dec-24
11
3130
02-Dec-24
0
2730
03-Dec-24
8
2930
04-...
0
votes
3
answers
89
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. ...
0
votes
0
answers
60
views
Can you use a comparison operator and an arithmetic operator in the same AVERAGEIFS formula?
I want to take the average of a set of numbers in one column (which we'll call column X) meeting a few different conditions: in one column (column A), there has to be matching text of the same ...
1
vote
1
answer
128
views
Is it possible to find the average of a group of numbers and return the index of the number furthest from the average with one loop?
Specifically:
Write a function (in python, java or pseudocode) average(nums) that prints the mean of the numbers in list nums, and returns a tuple:
The tuple's first element is the index of the ...
1
vote
5
answers
224
views
Calculate the average across multiple columns and looking up a condition
I am trying to average by each month over the last three years. I want to calculate it for each project, but without specifically matching it/tying it to the row (as when more projects are added it is ...
1
vote
3
answers
133
views
Average subset of sorted filtered values
I have the following set of values:
col1
Col2
1
20
2
155
3
170
4
177
5
291
6
559
7
794
8
820
9
1,198
10
1,240
11
1,259
12
1,537
13
1,613
14
1,876
15
1,949
16
1,950
17
2,274
18
2,372
19
2,640
20
3,030
...
1
vote
1
answer
62
views
Efficiently read in data in pandas dataframe and get average over a certain range
I'm reading in quite a lot of data from some text files and save it to dataframes to easily be able to access the columns later when processing the data in a later stage. I feel the way I'm currently ...
0
votes
1
answer
238
views
GROUP BY and calculate average
I would like to create a column in DAX where I calculate the average quantity sold. In the table I have the week number and the sold quantity on that specific week but in the additional column I would ...
0
votes
0
answers
44
views
update average price in stock when add new entry voucher
/articles(ID,Qte_stock,PU)/
/DETAILS_BON_ACHAT(ID,qte,prix,id_article)/
I want to update PU (price of product) in articles A table (items of stor) for each record in DETAILS_BON_ACHAT D table (
NOTE : ...
-1
votes
1
answer
78
views
weighted average from two table in mysql
i have two tables :
-items(id,quantity,price)
-entry_voucher(quantity,price,id_table1)
i want to calculate weighted average for every record in entry_voucher and update price in table items
i have ...
2
votes
3
answers
223
views
Sum of corresponding values from different arrays of the same size with Python
I'm rather new to Python so it's quite possible that my question has already been asked on the net but when I find things that seem relevant, I don't always know how to use them in my code (especially ...
0
votes
0
answers
56
views
DAX Expression for PBI
I have this 3 column (total wo, total ftf, product ftf %), I wanted to count the Binom.Dist using those 3 parameters. in excel you can simply put the formula of binom and fill in 3 paramaeters, but ...
-1
votes
1
answer
61
views
How to select the Average of a Sum column in the same result
I have a table of operations with dates and quantities.
dateTime
quantity
2024-01-01
1
2024-02-5
2
I want to sum the quantities for each month and then group by each month, which is working fine.
Then ...
1
vote
1
answer
95
views
Row wise average in SQL Server
I have a table in SQL Server named MyTable.
I want to calculate the row wise average of two columns (say val1 and val2). To my knowledge, I know that this can be done as shown below in my approach. ...
1
vote
1
answer
347
views
Get the average of the last 6 cells of a column with values
I'm trying to average the last 6 cells in a column. This data will be added to and I need it to update automatically as the data is added to.
I tried =AVERAGE(TAKE(FILTER(C5:C528,C5:C528<>0), ,-...
0
votes
1
answer
47
views
How to interleave columns in sqlite
In SQLITE I have a table with three columns like so:
X Y Z
_____
1,2,A
1,3,B
3,4,C
I want what follows, order of the rows does not matter.
U Z
___
1 A
2 A
1 B
3 B
3 C
4 C
So then I can GROUP BY U ...
2
votes
3
answers
319
views
Python: Average Values in 2D-Array
I want to generate a twodimensional array in Python and I would like to iterate through each element and take an average. An element i should be averaged using the 8 surrounding array elements (...
1
vote
2
answers
68
views
In SQL, what do I add below to average the depths by year?
The code before works just fine, but I can't figure out the next step at all. Next, I want all locations averaged by year and output a new column called annual_average.
My dataset is here: https://mgs-...
0
votes
1
answer
104
views
Is there a way to calculate the average distance of multiple points in R?
I have a dataset of 100 coordinates (in long/lat format) and have been able to map them using ggmap; they have different categories (ex. grocery stores versus gas stations).
I now need to calculate ...
0
votes
2
answers
142
views
How can I return average of array for each row in a PySpark dataframe?
Say I have data like the following:
from pyspark.sql import SparkSession
from pyspark.sql.types import ArrayType, DoubleType, StructField, StructType, LongType
spark = SparkSession.builder.appName(&...
1
vote
1
answer
64
views
I am getting the error "index 5 is out of bounds for axis 0 with size 5" for finding the average heights of an array
I am trying to find the average height of an array containing different heights. I have to find it using a while loop. Previously I did it with a for loop and it worked but when I try it this way I ...
1
vote
1
answer
50
views
Calculating the average time between StartTime and EndTime in VBA or in a calculated control. Then getting an average for many records
I want to get the average time between StartTime and EndTime in VBA or in a calculated control. Then get an average for many records.
I am using Access to build controls on a form that will show the ...
0
votes
2
answers
121
views
Excel extracting values from multiple tests
Ultimately I am trying to find the average of the top 3 values per test on the latest day for "Person 1". I am able to find the latest day using the Large(If()) formula, and I am able to ...
1
vote
1
answer
86
views
How to calculate a 3-day centered rolling average for measurements with varying numbers of measurements per date in R?
I have a dataset in R that contains methane measurements taken on different dates by of different cows. The dataset is structured as follows:
ID: An identifier for each cow (integer).
measure_date: ...
2
votes
1
answer
87
views
Power BI Average measure seems to ignore dates
I am new to both Power BI and Stack Overflow, but I am having a bit of trouble getting an AVERAGE measure to work on my data in Power BI.
I have a table of products with pricing for myself and the ...
2
votes
1
answer
105
views
Can `ave()` in `R` aggregate more than one variable over the list of variables as grouping elements
THIS POST seems relevant, but the example considers only one grouping variable (by). Is it possible to use ave() for several variables to be averaged on the basis of several grouping variables?
...
0
votes
1
answer
32
views
DAX Rolling Averages Totals on table doesnt show
On this SQLBI video rolling average doesnt calculate anything to totals row? Why is that? Would like to have snapshot value also for rolling value on card etc
https://www.youtube.com/watch?v=...
0
votes
0
answers
49
views
Calculating the ARE of parameters
I have the following code:
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate, optimize
import random
def dose(t, y, b, s, c, p, d):
target, infectious, virus = y
...
0
votes
0
answers
38
views
Adding Average at the very last part of the row and column in a dataset
I have a sample dataset of total outbound calls, it comprises rows (dates) and columns (hourly), my goal is to show totals and average of outbound calls per day (rows), and the totals and average of ...
0
votes
1
answer
20
views
MS access average of four values linked to a date and time
How can I combine the temperature values that has been measured every quarter in an hour to just one average value per hour? I want to make a query in MS Access. Can you provide a SQL to do this?
Time
...
1
vote
2
answers
94
views
How do I get a daily average for data points generated every 15 minutes?
This is my first question and I'm also a very new learner to r so please bear with me. I am working on some gauge data from about 4 months and it took temperature readings every 15 minutes. I am ...
4
votes
1
answer
713
views
Calculation of Average Queue Length in a Simple Queueing Model [closed]
Why does the average queue length in a single-queue system tend to infinity when the average number of arrivals equals the average number of departures?
Define the queue model parameters:
λ: Average ...
1
vote
0
answers
69
views
Implementing Continuous Averaging Memory for White Noise Signal in Simulink
I'm currently working on a project where I need to develop a continuous averaging memory to compute the average frequency spectrum of a white noise signal. The goal is to achieve a Degree of Freedom (...