Average of Last 3 values in range

Bradleeyb13

New Member
Joined
May 20, 2023
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
I would like to find the average of the last 3 values in a certain range (rows) D3:AX3, this range will have many blank cells scatter between values and I would like to find the average for the last 3 values input into that range
 
That answered my second question. What about my first question?

What does =ISNUMBER(T3) return if you put that in a empty cell?
A #NUM! error would occur with my formula if there are no numbers in the range, which again emphasises the need to check if they are actually numbers and not text.


Test of concept:
Start a fresh worksheet.
Click this icon at the top left of my Mini Sheet in post #4: View attachment 91995
Select cell A3 in the blank worksheet
Paste
What appears in cell A3?


We can't really tell much from a screenshot. What about range A1:V10 from your worksheet posted with XL2BB instead so we can check with your actual data?
I have just got this formula working within a new sheet, the only issue I have now is that it counts all cells not excluding blanks or zeros.
Any idea to fix this?
I added "ISNUMBER" behind average but that just returns "0"


=AVERAGE(INDEX(B2:S2,0,COLUMNS(B2:S2)-(W1-1)):INDEX(B2:S2,0,COLUMNS(B2:S2)))

Thanks!
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I have combined your two threads together.

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted. Simply continue on in your original question.
If I get no further replies am I able to make a new thread?
 
Upvote 0
If I get no further replies am I able to make a new thread?
If the question is ongoing #12 of the Forum Rules precludes that. However, that rule also advises about 'bumping' your thread occasionally to get it at or near the top of the forum. Of course not all forum threads get a resolution either.

For some reason I seem to have stopped getting notifications of responses to this thread so I hadn't seen that there were further posts. Luckily I just happened to see it today.

Since it quite some time since I was dealing with this it is no longer fresh in my mind. Could we have some sample data, expected results and explanation in relation to that sample data?

It would be best with XL2BB. You have indicated problems with the add-in. What exactly is the problem? Could this be it? XL2BB Icons greyed out
 
Upvote 0
If the question is ongoing #12 of the Forum Rules precludes that. However, that rule also advises about 'bumping' your thread occasionally to get it at or near the top of the forum. Of course not all forum threads get a resolution either.

For some reason I seem to have stopped getting notifications of responses to this thread so I hadn't seen that there were further posts. Luckily I just happened to see it today.

Since it quite some time since I was dealing with this it is no longer fresh in my mind. Could we have some sample data, expected results and explanation in relation to that sample data?

It would be best with XL2BB. You have indicated problems with the add-in. What exactly is the problem? Could this be it? XL2BB Icons greyed out
Okay I got that working, thanks!

This is the data I am dealing with..

Disposals Auto 2023.xlsm
ABCDEFGHIJKLMNOPQRSTU
1PlayerR1R2R3R4R5R6R7R8R9R10R11R12R13R14R16R17R18R19R20Tot
2Baker, Oskar13131820111520151520152241412227
3Bontempelli, Marcus25242825233119322530272331322729312927518
WB
Cells with Conditional Formatting
CellConditionCell FormatStop If True
1:1048576Cell Valuecontains "Y E S"textNO
1:1048576Cell Valuecontains "Yes"textNO
1:1048576Cell Valuebeginning with "No"textNO
1:1048576Cell Value<0textNO
1:1048576Cellcontains a blank value textNO
1:1048576Cellcontains an errortextNO


With 2 different players we have player "Baker, Oskar" with a handful of blanks scattered across his range where I would like to get the average for the last 3 games he has played in (N2,O2,S2). The second player "Bontempelli, Marcus" has played the last 3 games and is easy to create a formula to work out his last 3 average.

Thanks!
 
Upvote 0
Glad you were able to get XL2BB going. (y)

So, doesn't the formula suggested in post #2 do what you want if you adjust it to your ranges?

23 07 31.xlsm
ABCDEFGHIJKLMNOPQRSTUVW
1PlayerR1R2R3R4R5R6R7R8R9R10R11R12R13R14R16R17R18R19R20TotAverage last 3
2Baker, Oskar1313182011152015152015224141222710
3Bontempelli, Marcus2524282523311932253027233132272931292751829
Average
Cell Formulas
RangeFormula
W2:W3W2=AVERAGE(INDEX(B2:T2,1,LARGE(IF(B2:T2<>"",COLUMN(B2:T2)-COLUMN(B2)+1),MIN(3,COUNT(B2:T2)))):T2)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Glad you were able to get XL2BB going. (y)

So, doesn't the formula suggested in post #2 do what you want if you adjust it to your ranges?

23 07 31.xlsm
ABCDEFGHIJKLMNOPQRSTUVW
1PlayerR1R2R3R4R5R6R7R8R9R10R11R12R13R14R16R17R18R19R20TotAverage last 3
2Baker, Oskar1313182011152015152015224141222710
3Bontempelli, Marcus2524282523311932253027233132272931292751829
Average
Cell Formulas
RangeFormula
W2:W3W2=AVERAGE(INDEX(B2:T2,1,LARGE(IF(B2:T2<>"",COLUMN(B2:T2)-COLUMN(B2)+1),MIN(3,COUNT(B2:T2)))):T2)
Press CTRL+SHIFT+ENTER to enter array formulas.
The error I get on this is "#VALUE!",

Looking back on the thread I conducted the "=ISNUMBER" on one of the random cells and got a return of "FALSE".
How do I turn the values to numbers? When I change the number format to number it still remains false..
 
Upvote 0
The error I get on this is "#VALUE!",

Looking back on the thread I conducted the "=ISNUMBER" on one of the random cells and got a return of "FALSE".
How do I turn the values to numbers? When I change the number format to number it still remains false..
Further more to add to the confusion, I thought I would test more than 1 cell with "=ISNUMBER" and I have found that cell H2 returns a "FALSE" where as cell M2 returns "TRUE". How can this be if all data is from the same source? how can I convert all to numbers?
Cheers!
 
Upvote 0
ll data is from the same source?
What is the source of the "numbers"?
I would be trying to fix the data at the source as 'numbers' that are not numbers will make things difficult.

When I change the number format to number it still remains false.
Changing the format of the cell does not change the nature of the underlying value in the cell which will remain text.
 
Upvote 0
What is the source of the "numbers"?
I would be trying to fix the data at the source as 'numbers' that are not numbers will make things difficult.


Changing the format of the cell does not change the nature of the underlying value in the cell which will remain text.
It is an external source (data from a website), more specifically a table from the website.
 
Upvote 0
It is an external source (data from a website), more specifically a table from the website.
All the values that look like numbers in your post #14 sample come across from XL2BB as actual numbers. Does that mean that XL2BB has coerced them to numbers or is that data not representative of your actual "mixed" data?
If not representative, can you post some with XL2BB that is representative?
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,321
Members
449,218
Latest member
Excel Master

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