Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I have column J - populated only by numbers except for the header - for which I need the average value.
No problem up to this point.
Now, the operation becomes harder.
1) I have to calculate the average of the values in column J that in column B (and same row) have the value "ALPHA" or "BETA";
2) Then, with reference to the point 1, I need to calculate the average of the 50 higher values.
Any suggestions?
Thank's.
I have column J - populated only by numbers except for the header - for which I need the average value.
Code:
Dim lastrow_g As Long
lastrow_g = Cells(Rows.Count, "J").End(xlUp).Row
Dim range_average As Range
Set range_average = Range("J2:J" & lastrow_g)
Dim aver as Variant
aver = Application.WorksheetFunction.average(range_average)
No problem up to this point.
Now, the operation becomes harder.
1) I have to calculate the average of the values in column J that in column B (and same row) have the value "ALPHA" or "BETA";
2) Then, with reference to the point 1, I need to calculate the average of the 50 higher values.
Any suggestions?
Thank's.
Last edited: