Solved

finding average of last 5 payments

Posted on 2014-11-11
4
74 Views
Last Modified: 2014-11-15
hi Folks
Got this issue. A customer wants to find a way to calculate the average of the last 5 payments made to employees. I've attached a file with the required answer...of course people will finish at different times, they may not get paid every week. So essentially it means find the last 5 cells with entries in them and get the average..
finding-average-of-last-5-payments.xlsx
0
Comment
Question by:agwalsh
4 Comments
 
LVL 18

Assisted Solution

by:krishnakrkc
krishnakrkc earned 200 total points
ID: 40434656
Hi

There may be better ways...In M3 and copied down

=AVERAGE(INDEX(B3:L3,,LARGE(IF(B3:L3<>"",COLUMN(B3:L3)-COLUMN(B3)+1),5)):L3)

It's an array formula. Confirmed with CTRL+SHIFT+ENTER

Kris
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 200 total points
ID: 40434657
In M3:
=AVERAGE((INDEX(B3:L3,LARGE(IF(B3:L3<>"",COLUMN(B3:L3)-1),MIN(5,COUNT(B3:L3)))):L3))
entered with Ctrl+Shift+Enter, then fill down.

(the MIN part is there in case there are less than 5 numbers available)
0
 
LVL 2

Accepted Solution

by:
Pratik Makwana earned 100 total points
ID: 40434679
attached is your excel with result...
finding-average-of-last-5-payments-1-res
0
 

Author Closing Comment

by:agwalsh
ID: 40444228
@Rory Archibold and @ krishnakrkc. Thank you both for an elegant, wonderful formula. A Thing of Beauty indeed. I gave Rory the Best Solution because he wove the Min function into it. @Pratik. I gave you a lower score because I simply couldn't open the file you sent me.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question