Average If

Rob P.

New Member
Joined
Feb 23, 2002
Messages
29
I want to average the last 5 cells which are not null.
A B C D E F G H
Person A 39 47 47 43 52 50
Person B 59 56 59 51 52 48

Person A would be the average of D:H, Person B would be the average of C:H. What formula would I enter in Column I to accomplish this?

Thanks,
Rob P.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I want to average the last 5 cells which are not null.
A B C D E F G H
Person A 39 47 47 43 52 50
Person B 59 56 59 51 52 48

Person A would be the average of D:H, Person B would be the average of C:H. What formula would I enter in Column I to accomplish this?

Thanks,
Rob P.
Will there ALWAYS be at least 5 cells with numbers in them to average?

If not, then what should happen?
 
Upvote 0
Yes there will be. Sorry for not using the HTML tool, I have yet to be able to get it to work at the office.
 
Upvote 0
Yes there will be. Sorry for not using the HTML tool, I have yet to be able to get it to work at the office.
Try this array formula**:

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

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

Adjust the ranges to suit.
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,887
Members
452,948
Latest member
Dupuhini

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