Excel - Sum of data at equal intervals - excel

I have some time series longitude latitude data which I am trying to sum up for each month. ( 4 x column headings Time, long, lat, precipitation).
Is there a way of summing data automatically for regular intervals or do I have to manually update the sum equation code cell?
Any help would be hugely appreciated.
Many thanks
I have tried summing it manually but due to large data mass this will take along time.

You can very easily find the month number of a date, using the =Month() worksheet function. Adding such a column might give you the possibility to use the basic "Subtotals" feature of Excel, as you can see in this screenshot:

Related

Averaging specific range of data with loop in excel vba

I have a temperature data taken in every second (1Hz).
I want to reduce this data to minutes combined with averaging every 60 seconds of data. Which will be look like this.
I have tried moving average and other things but it didn't work. Is there any VBA code that i can approach my goal or any spesific function.
My time data range is [A3] - [A88739] and data range is [B3] to [B99739]
I will be waiting for your answers.
Thank you!
I think easier way would be using a helper column.
This will work only if your time data is always like the one you've posted and if the last 6 chars are .XXXXX where X can be letter or numbers, but leading dot is critical
My formula in column C is =VALUE(SUBSTITUTE(LEFT(A3;LEN(A3)-6);".";"/"))
Then with Pivot Table you can group your data by day,hour and minute, and get the average.
Setup of My Pivot Table:
Field Helper into rows section, and grouped by days, hours and minutes
Field Temp into values section, and choose average instead of sum up

Excel average if function for obtaining hourly data

I have minute data for air temperature and relative humidity (about 930,000 cells) for a building and I am trying to obtain the hourly average using excels "AverageIF" function. Here's the criteria that I have come up with: whenever one hour passes, average the air temperature and relative humidity for that hour. I am having trouble communicating these criteria to excel and any help would be appreciated. I have included a pic of what my data looks like:
the yellow row is me manually adding a row after an hour has passed and calculated the average using the average function.
In the example above I went a bit long winded in the formula to deal with time intervals where there was no data, as that generates a divide by 0 error.
Essentially what I did was setup a summary table to the right. I gave a start and end time for each hour (ASSUMING this is based on a 24 hour clock and not 1 hour from some arbitrary start time)
I used the AVERAGEIFS function as you have two criteria. Everything after a start time and everything before an end time. Only lines that match BOTH criteria are included.
The basic formula looks like this and is based on my example cell J4:
AVERAGEIFS(E$4:E$31,$C$4:$C$31,">="&$H4,$C$4:$C$31,"<="&$I4)
If the date is important, then you would need to add a date column to the table on the right and add a third criteria to the formula above.
In order to deal with divide by zero error and display blank instead of zero so you can distinguish between actual average of 0 and no data and still presenting an error when another type of error comes up I use the following formula in J4:
=IFERROR(AVERAGEIFS(E$4:E$31,$C$4:$C$31,">="&$H4,$C$4:$C$31,"<="&$I4),IF(ERROR.TYPE(AVERAGEIFS($E$4:$E$31,$C$4:$C$31,">="&$H4,$C$4:$C$31,"<="&$I4))=2,"","ERROR"))
The above formulas can be copied down and to the right.

Formula using Sum product calculate total hours in overlapping date array

Please help,
I want to calculate the actual downtime per each type of equipment and per each type of work order, as shown in the following table sample of the data which extend in real file to 6000 rows:
Data table
, when I use this formula:
{=SUMPRODUCT((COUNTIFS(K2:K6000,"<"&MIN(K2:K6000)+ROW(INDIRECT("1:"&ROUND((MAX(L2:L6000)-MIN(K2:K6000))*1440,0)))/1440-1/2880,L2:L6000,">"&MIN(K2:K6000)+ROW(INDIRECT("1:"&ROUND((MAX(L2:L6000)-MIN(K2:K6000))*1440,0)))/1440-1/2880,G2:G6000,"*"&P3&"*",A2:A6000,"PRMN")>0)+0)/60}
I take a long time to calculate as I use it for 6000 rows with extra 2 criteria, so how I can improve this formula to be faster?
Best Regards,
Mahmoud Hazem

Excel calculate the duration between two weekdays time

Hi,
I have this table with me, each record represents one file. My objective is to calculate out the duration for the file to complete.
I stuck at some files are completed within the same day, while some files might complete only after 1 or 2 or 3 days.
Are there any formulas to calculate it out?
Thanks.
You are better off with a single date and time column then use something like the below. Otherwise combine the date and time yourself first
=(TIMEVALUE(B2)-TIMEVALUE(C2)+(TIMEVALUE(B2)<TIMEVALUE(C2)))*24
I think I found a way to achieve that. Solution
First I would apologize for my unclear question. The weekdays are text format, the weekend doesn't count, and the durations are confirmed within one week period.
I actually did the below steps and achieved to my objective.
Convert all the weekdays to numbers, refer to column J and K.
Column L is the variance between column J and K. L=K-J
Then the duration M column put this formula will do.
=IF(L2=0,MOD(I2-G2,1)*24,IF(AND(L2=1,I2>=G2),MOD(I2-G2,1)*24+L2*24,IF(AND(L2=2,I2>=G2),MOD(I2-G2,1)*24+L2*24,IF(AND(L2=3,I2>=G2),MOD(I2-G2,1)*24+L2*24,MOD(I2-G2,1)*24+(L2-1)*24))))

Statistical functions on non-numerical value

I am not looking for any code or formula but a rationale/logic.
Background: My data set comes in Date/Time format where a new timestamp is created for each new occurrence of an event.
My goal is to calculate number of occurrences within each hour for a given day. Unfortunately, system does not capture number if occurrences per period as integers. So I have count the number of time an hour value appears within the hour i.e number of times 4 o'clock hour appears. I am currently using Pivot Table in Excel to count the number of times each hour appears. Fields in Rows are hour and dates, and field in Values is count of hour.
Trouble is that I cannot use any summarize functions to get stuff like sum, min, max, percentile, and standard deviation. For example, changing count to sum will only add up all hours. So sum of 4 o'clock hour will return 12 instead of 3. So I am having to use array formulas on pivot table to give me max and min etc.
If I was to use this data in data viz tools like Tableau or Power BI. I won't be able to get very far. I am looking for a suggestions/workaround that can allow me to manipulate my data in a way so it can be used in Pivot Tables in Excel and in data viz tools.
I know my questions is not specific to one tool but I am looking to enhance me understanding of data and data manipulations techniques.
EDIT: Please see attached image
Build a data model, using PowerPivot. Join your fact table to a calendar dimension table. Create a row count measure - you can then summarise that measure to suit (sum, average, min, etc)

Resources