Excel Function : AVERAGEIF
Category
Statistical
Description
Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria
Microsoft Excel Reference Page
https://support.office.com/en-us/article/AVERAGEIF-function-faec8e2e-0dec-4308-af69-f5576d8ac642
Syntax and Description of the AVERAGEIF Excel Function
I want to get average of a column by using if statement. i.e. if value of column = 1 then average of all values which are equal to 1. I am using sql server. Please help. Thanks in advance. A: You can usePossible Duplicate:
AVERAGEIF function in SQL Server
AVG()
with WHERE
About AVERAGEIF Excel Function
The AVERAGEIF function calculates the average of all cells that meet a certain criteria. The syntax for the AVERAGEIF function is: AVERAGEIF(range, criterion, [average_range]) Range is the range of cells that you want to evaluate. Criterion is the criteria that you want to use to determine which cells to include in the average. Average_range is an optional argument that specifies the range of cells to average. If omitted, the cells in range are used.