Average or occurrences help needed

maximus315

New Member
Joined
Aug 2, 2011
Messages
7
I need to quickly evaluate pump rates.

I have an output (pump gpm) that gets recorded to excel every minute in a new row. The pump turns on an off multiple times a day depending on build up. What I want is to know the number of occurrences a day that the pump turns on and the average gpm during these time frames (the pump on time for each event also varies) and sometimes there is blips at startup of an occurrence.


Occurrences were added in the table by hand in the example below.






[TABLE="width: 409"]
<tbody>[TR]
[TD][/TD]
[TD]Data[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]occurrence[/TD]
[TD]GPM[/TD]
[TD][/TD]
[TD] Desired output[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]occurrence[/TD]
[TD]average gpm[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]175.3245[/TD]
[TD][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]174.6[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]175.6294[/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]152.43[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]173.9357[/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]174.1177[/TD]
[TD][/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]174.2998[/TD]
[TD][/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]174.4818[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]174.6638[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]173.6071[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]174.2018[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]176.7737[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]174.1055[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]173.8339[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]175.6286[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: right"]173.8325[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]24.56381[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]1.924029[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]14.86348[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]1.62[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]3.057903[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]3.343711[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]14.5067[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]12.77087[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]3.227844[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]114.8468[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]197.5547[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]244.9118[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]266.7711[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]274.3633[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]283.6748[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]285.0492[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]296.478[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]313.9584[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]338.4923[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: right"]352.7092[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi, Below should work if you data range header is in A1 & B1 and data starting in A2&B2:


Book1
DE
1Desired output
2occurrenceaverage gpm
31174.6026
42152.4344
53
64
75
Sheet1
Cell Formulas
RangeFormula
E3=IFERROR(AVERAGEIFS($B$2:$B$48,$A$2:$A$48,D3),"")
 
Upvote 0
Try below:


Book1
DEF
1Desired output
2occurrenceaverage gpm
31174.6026174.6
42152.4344152.43
5
6
7
8
9
Sheet1
Cell Formulas
RangeFormula
D3=IFERROR(INDEX($A$2:$A$48,AGGREGATE(15,6,(ROW($A$2:$A$48)-ROW($A$2)+1)/(MATCH($A$2:$A$48,$A$2:$A$48,0)=(ROW($A$2:$A$48)-ROW($A$2)+1)),ROWS(D$3:D3))),"")
E3=IF(D3="","",IFERROR(AVERAGEIFS($B$2:$B$48,$A$2:$A$48,D3),""))
 
Upvote 0
Sorry I was not clear,

I am trying to fill in column A to start with - the only data at the start is in column B (the GPM)
I want excel to determine the occurrences (pump start to stop is 1 occurrence)

thanks for the help
 
Upvote 0
So in the example you gave, occurrences should be 4 right row 2 to row 15 - 1st , then row 26 - 2nd occurrence , then there is a gap of row 27 and hence row 28 - 3rd occurrence and row 31 to 48 is 4th ?
 
Upvote 0
if the understanding from post #6 is correct then below should work (Showing only part of data):


Book1
ABCDE
1OccurrenceGPMDesired output
21175.3245occurrenceaverage gpm
31175.62941174.6026
41173.9357224.56381
51174.117731.924029
61174.29984167.9
71174.4818
81174.6638
91173.6071
101174.2018
111176.7737
121174.1055
131173.8339
141175.6286
151173.8325
160
170
180
190
200
210
220
230
240
250
26224.56381
270
2831.924029
Sheet1
Cell Formulas
RangeFormula
A3=IF(B3>0,IF(A2="",MAX(A$2:A2)+1,MAX(A$2:A2)),"")
D3=IFERROR(INDEX($A$2:$A$48,AGGREGATE(15,6,(ROW($A$2:$A$48)-ROW($A$2)+1)/(MATCH(($A$2:$A$48)*($A$2:$A$48<>""),$A$2:$A$48,0)=(ROW($A$2:$A$48)-ROW($A$2)+1)),ROWS(D$3:D3))),"")
E3=IF(D3="","",IFERROR(AVERAGEIFS($B$2:$B$48,$A$2:$A$48,D3),""))


Putting down 1 manually in A2
Copy formula from A3 down
Copy formula from D2 down
Copy formula from E2 down
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top