Need to Ignore Alpha in Array (using to take average of last 5 entries)

bhall1183

New Member
Joined
Aug 24, 2017
Messages
2
I'm trying to update an existing formula/array that has been working well to accommodate an additional request. Right now, this formula takes the average last five entries in a row from the leftmost entry. I need to update this to ignore alphas (specifically, an "x") from impacting the average and the count of last five entries.

Current formula:
{=SUM(IF(COLUMN(R3:CC3)>=LARGE(IF(R3:CC3<>"",COLUMN(R3:CC3)),5),R3:CC3))/5}
*works well w/out alphas, but w/alphas, it counts it as an entry of 0

Attempt #1 :
{=SUM(IF(ISNUMBER(COLUMN(R3:CC3))>=LARGE(IF(R3:CC3<>"",COLUMN(R3:CC3)),5),R3:CC3))/5}
*ignores alphas, but no longer averages correctly -
Example - 10 entries of 1, should average to 1, but it calculates it to 2
[TABLE="width: 330"]
<tbody>[TR]
[TD="class: xl64, width: 33"]1[/TD]
[TD="class: xl63, width: 33"]1[/TD]
[TD="class: xl63, width: 33"]1[/TD]
[TD="class: xl63, width: 33"]1[/TD]
[TD="class: xl64, width: 33"]1[/TD]
[TD="class: xl64, width: 33"]1[/TD]
[TD="class: xl64, width: 33"]1[/TD]
[TD="class: xl63, width: 33"]1[/TD]
[TD="class: xl63, width: 33"]1[/TD]
[TD="class: xl63, width: 33"]1[/TD]
[/TR]
</tbody>[/TABLE]
This should only look at the last five, but I'm getting a value of 2

[TABLE="width: 330"]
<tbody>[TR]
[TD="class: xl66, width: 33"][TABLE="width: 330"]
<tbody>[TR]
[TD="class: xl66, width: 33"]1[/TD]
[TD="class: xl65, width: 33"]1[/TD]
[TD="class: xl65, width: 33"]1[/TD]
[TD="class: xl65, width: 33"]x[/TD]
[TD="class: xl66, width: 33"]1[/TD]
[TD="class: xl66, width: 33"]1[/TD]
[TD="class: xl66, width: 33"]x[/TD]
[TD="class: xl65, width: 33"]1[/TD]
[TD="class: xl65, width: 33"]1[/TD]
[TD="class: xl65, width: 33"]1[/TD]
[/TR]
</tbody>[/TABLE]
This should be 1, ignoring the 2nd "x", but I get 1.6[/TD]
[TD="class: xl65, width: 33"][/TD]
[TD="class: xl65, width: 33"][/TD]
[TD="class: xl65, width: 33"][/TD]
[TD="class: xl66, width: 33"][/TD]
[TD="class: xl66, width: 33"][/TD]
[TD="class: xl66, width: 33"][/TD]
[TD="class: xl65, width: 33"][/TD]
[TD="class: xl65, width: 33"][/TD]
[TD="class: xl65, width: 33"][/TD]
[/TR]
</tbody>[/TABLE]

Any thoughts? Thanks!
 
Try...

=SUM(IF(ISNUMBER(A2:J2),IF(COLUMN(A2:J2)>=LARGE(IF(ISNUMBER(A2:J2),COLUMN(A2:J2)),5),A2:J2)))/5

...confirmed with CONTROL+SHIFT+ENTER. Adjust the ranges accordingly.

Hope this helps!
 
Upvote 0

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