Averaging Data Every 20 Seconds

Geijer85

New Member
Joined
Jun 16, 2013
Messages
6
I'm in great need of formula to save me an extreme amount of time and angst. I am attempting to average blood vessel dilation every 20 seconds. I have seconds recorded in one column and diameter in another column. The issue I'm having is that time is not recorded consistently.


Time (sec)Percent Dilation
0
1.016
2.370.678
4.4380.339
4.8751.356
6.9061.016
12.1561.355
13.3440.678
14.016-1.017
14.4221.102
17.563-0.399
18.0631.356
19.2791.017
20.8281.356
24.5631.011
29.5631.069
30.3751.016
31.1720
31.9380.677
36.4410.998
39.981.110
41.3530.976
43.5471.359
44.1121.234

<tbody>
</tbody>

Please, please help.

Thank you.
 
Could it be that the seconds and the diameter are calculated with formulas rather than being typed directly?
That shouldn't matter if the results of those formulas are actual numbers, which you have reported they are.



I tried copying those columns to a new sheet and pasting the values only and everything works to perfection! Thank you, Peter!
That's good, but I have sent you a PM as I'm interested in finding out why it was not working already. Check "Private Messages" in the green section at the top left of the page.
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I small modification in the Peter's formula:

Code:
K2-> =AVERAGEIFS(J$2:J$778,I$2:I$778,">="&(ROW(K2)-ROW(K$2))*20,I$2:I$778,"<"&(ROW(K2)-ROW(K$2)+1)*20)

Markmzz
 
Upvote 0
I small modification in the Peter's formula:
Although that will produce the results without the helper cells, I would argue it is less useful..

a) If this was dragged down more than just a few rows it would become increasingly unclear what time period a particular result belonged to.

b) If it is subsequently decided to change the time period from 20 seconds to some other number, I think it easier to just change my cell M2 than to alter the formula and re-copy it down. Again the visibility of the start value of each time-period and its duration would be useful for the sheet viewer/user in this circumstance.

Anyway, that's just my view and you have certainly offered the OP an alternative that they may choose to use. :)



(BTW, if avoiding the helper cells, using ROWS instead of ROW would allow a slight shortening and a reduction in the number of function calls)
Rich (BB code):
=AVERAGEIFS(J$2:J$778,I$2:I$778,">="&(ROWS(K$2:K2)-1)*20,I$2:I$778,"<"&ROWS(K$2:K2)*20)
 
Upvote 0
Although that will produce the results without the helper cells, I would argue it is less useful..

a) If this was dragged down more than just a few rows it would become increasingly unclear what time period a particular result belonged to.

b) If it is subsequently decided to change the time period from 20 seconds to some other number, I think it easier to just change my cell M2 than to alter the formula and re-copy it down. Again the visibility of the start value of each time-period and its duration would be useful for the sheet viewer/user in this circumstance.

Anyway, that's just my view and you have certainly offered the OP an alternative that they may choose to use. :)



(BTW, if avoiding the helper cells, using ROWS instead of ROW would allow a slight shortening and a reduction in the number of function calls)
Rich (BB code):
=AVERAGEIFS(J$2:J$778,I$2:I$778,">="&(ROWS(K$2:K2)-1)*20,I$2:I$778,"<"&ROWS(K$2:K2)*20)

I only offered another way (not the most smart), but another way.

Anyway, I think that the important thing is to solve the user problem.

Markmzz
 
Upvote 0

Forum statistics

Threads
1,216,466
Messages
6,130,795
Members
449,593
Latest member
morpheous

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