#### FaridWahidi

##### Board Regular

- Joined
- Apr 22, 2014

- Messages
- 93

Hi,

I am a bit confused what is the accurate approach to be used in calculating average with multiple string criteria in the same criteria range.

I have try AverageIfs but the output is totally wrong

I am a bit confused what is the accurate approach to be used in calculating average with multiple string criteria in the same criteria range.

I have try AverageIfs but the output is totally wrong

Code:

```
Sub Calculate()
Dim JobPosition As Variant
Dim rng_1, rng_2, rng_3, rng_4 As Range
Dim ws As Worksheet
JobPosition = Array("Officer", "Executive")
Set ws = Worksheets("Score")
With Application.WorksheetFunction
For i = LBound(JobPosition) To UBound(JobPosition)
ws.Range("C4").Value = ws.Range("C4").Value + .CountIfs(rng_1, "Global Banking", rng_2, ">0", rng_3, JobPosition(i))
ws.Range("D4").Value = ws.Range("D4").Value + .SumIfs(rng_3, rng_1, "Global Banking", rng_2, ">0", rng_3, JobPosition(i))
ws.Range("F4").Value = ws.Range("F4").Value + [COLOR=#ff0000].AverageIfs[/COLOR](rng_4, rng_1, "Global Banking", rng_2, ">0", rng_3, JobPosition(i))
Next i
End With
End Sub
```

Last edited: