Sumif function in excel
However, when the range and sum_ range arguments in the SUMIF function do not contain the same number of cells, worksheet recalculation may take longer than expected. The actual cells that are added are determined by using the upper leftmost cell in the sum_range argument as the beginning cell, and then including cells that correspond in size and shape to the range argument. The sum_range argument does not have to be the same size and shape as the range argument. The SUMIF function returns incorrect results when you use it to match strings longer than 255 characters or to the string #VALUE!. If you want to find an actual question mark or asterisk, type a tilde ( ~) preceding the character. A question mark matches any single character an asterisk matches any sequence of characters. You can use the wildcard characters-the question mark ( ?) and asterisk ( *)-as the criteria argument. If the sum_range argument is omitted, Excel adds the cells that are specified in the range argument (the same cells to which the criteria is applied). The actual cells to add, if you want to add cells other than those specified in the range argument. If the criteria is numeric, double quotation marks are not required. Important: Any text criteria or any criteria that includes logical or mathematical symbols must be enclosed in double quotation marks ( "). For example, criteria can be expressed as 32, ">32", B5, "32", "apples", or TODAY(). The criteria in the form of a number, expression, a cell reference, text, or a function that defines which cells will be added. The selected range may contain dates in standard Excel format (examples below).Ĭriteria Required. Cells in each range must be numbers or names, arrays, or references that contain numbers. The range of cells that you want evaluated by criteria. The SUMIF function syntax has the following arguments: To sum cells based on multiple criteria, see SUMIFS function. For example, the formula =SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal "John." Tips: If you want, you can apply the criteria to one range and sum the corresponding values in a different range. This video is part of a training course called Add numbers in Excel 2013.