Average Last 5 in row, excluding blanks

chrisb182

New Member
Joined
Mar 3, 2022
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I've seen many answers to this question on here but none of them are working for my spready.

Basically I want to average the last 5 numbers in a row, excluding any blanks.

Here's a screenshot of some numbers I'm working with, with the expected result.

If someone could help, I'd be immensely grateful!

Cheers,

Chris

1669120493896.png
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
In that case I would suggest you update your profile. ;)
Two other options depending on whether you have the new Take function or not
Excel Formula:
=AVERAGE(TAKE(FILTER(D2:O2,D2:O2<>0),,-5))
or
Excel Formula:
=LET(f,FILTER(D2:O2,D2:O2<>0),AVERAGE(INDEX(f,SEQUENCE(,MIN(5,COLUMNS(f)),COLUMNS(f),-1))))
 
Upvote 0
In that case I would suggest you update your profile. ;)
Two other options depending on whether you have the new Take function or not
Excel Formula:
=AVERAGE(TAKE(FILTER(D2:O2,D2:O2<>0),,-5))
or
Excel Formula:
=LET(f,FILTER(D2:O2,D2:O2<>0),AVERAGE(INDEX(f,SEQUENCE(,MIN(5,COLUMNS(f)),COLUMNS(f),-1))))
Hahaha. Marvellous.

Cheers buddy.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,114
Members
452,302
Latest member
TaMere

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