Averaging the difference between multiple cells and excluding blank values

SMAusa

New Member
Joined
Mar 4, 2015
Messages
3
I have a large data set where I need to find the average difference between two rows, but need to exclude the columns where either cell in the two rows is blank. For example here are just a few columns:

[TABLE="width: 864"]
<colgroup><col span="8"></colgroup><tbody>[TR]
[TD="align: right"]23:10:00 +00
[/TD]
[TD="align: right"]02:03:00 +01[/TD]
[TD][/TD]
[TD="align: right"]01:44:00 +01[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]22:04:00 +00[/TD]
[/TR]
[TR]
[TD="align: right"]23:18:00 +00
[/TD]
[TD="align: right"]02:10:00 +01[/TD]
[TD="align: right"]00:14:00 +01[/TD]
[TD="align: right"]01:51:00 +01[/TD]
[TD][/TD]
[TD="align: right"]01:45:00 +01[/TD]
[TD="align: right"]00:35:00 +01[/TD]
[TD="align: right"]22:10:00 +00[/TD]
[/TR]
</tbody>[/TABLE]

I need to find the average difference between the two rows, but where there is data missing (for example on the third column, there is only a second value but the first is missing, the fifth column is completely blank), I want excel to completely ignore those two columns and not include any part of it in the average.

What formula(s) do I use in order to achieve this?

Any help would be much appreciated!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
See if this might work.
NOTE: This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Excel Workbook
ABCDEFGH
123:10:002:03:001:44:0022:04:00
223:18:002:10:000:14:001:51:001:45:000:35:0022:10:00
3
4Average0.004861111
Sheet
 
Upvote 0
See if this might work.
NOTE: This is an array formula and must be entered with CTRL-SHIFT-ENTER.

*ABCDEFGH
****
*
********
Average******

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:88px;"><col style="width:97px;"><col style="width:64px;"><col style="width:95px;"><col style="width:64px;"><col style="width:91px;"><col style="width:97px;"><col style="width:115px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="align: right"]23:10:00[/TD]
[TD="align: right"]2:03:00[/TD]

[TD="align: right"]1:44:00[/TD]

[TD="align: right"]22:04:00[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]23:18:00[/TD]
[TD="align: right"]2:10:00[/TD]
[TD="align: right"]0:14:00[/TD]
[TD="align: right"]1:51:00[/TD]

[TD="align: right"]1:45:00[/TD]
[TD="align: right"]0:35:00[/TD]
[TD="align: right"]22:10:00[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="bgcolor: #ffff00, align: right"]0.004861111[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
B4{=AVERAGE(IF(A1:H1<>"",IF(A2:H2<>"",A2:H2-A1:H1),""))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

I think that works! Thanks a million!
 
Upvote 0
You're welcome. Thanks for the feedback and welcome to the form.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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