A brief analysis of the usage of sumif() and countif() in Excel function learning
When we use Excel to create tables to organize data, we use its built-in functions to assist operations, which can improve operational efficiency. Today we will learn how to use Excel functions. Let’s first learn about the application of sumif and countif functions. I hope it will be helpful to everyone!
Part 1: How to use the sumif function
The Sumif function is to specify a pair based on given conditions Cell sum.
First of all, we use a simple data to understand how to use the Sumif function. The picture below is a worksheet source data.
Use the SUMIF function to find the cells in column A that are greater than 15, and sum them with their corresponding cells in column B.
Enter in the evaluation cell: =SUMIF(A1:A4,">15",B1:B4)
, and the result is 900.
The meaning of the formula is that because the data in A2, A3, and A4 meet the condition ">15", the corresponding data in B2, B3, and B4 are summed and calculated.
The syntax of the SUMIF function is: SUMIF(range,criteria,sum_range)
The parameters are introduced as follows:
First, range: is the range of cells to be calculated based on conditions. Cells in each range must be numbers and names, arrays, and references containing numbers. Empty values and text values are ignored.
Second, Criteria: The conditions for determining which cells to add, which can be in the form of numbers, expressions or text. For example, the condition could be expressed as 65, "65", ">65", or "apples".
Third, Sum_range: is the actual cells to be added (if the relevant cells in the range meet the conditions). If sum_range is omitted, cells in the range are both evaluated conditionally and added when they match the condition.
Sumif function supports wildcard calculation. You can use wildcard characters, question marks (?), and asterisks (*) in criteria. A question mark matches any single character; an asterisk matches any string of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
Part 2: Application case analysis of sumif function and COUNTIF function
First question: The SUMIF function is used to find And, the COUNTIF function is used for counting. Use these two functions for summation and counting applications respectively.
#1. Column C of the following worksheet is the source data. Find the number greater than 50 and less than 100.
The formula is: =COUNTIF($C2:$C10,">"&E2)-COUNTIF(C2:C10," >"&F2)
, the result is 4.
You can also nest the SUM function to calculate, the formula is: =SUM(COUNTIF(C2:C10,{">50",">=100"})*{1,-1} ).
2. Find the sum greater than 50 and less than 100.
For summation, we only need to replace COUNTIF in the above formula with the sumif function.
The formula is: =SUMIF($C2:$C10,">"&E2)-SUMIF(C2:C10,">"&F2)
, the result is: 274 .
Or use the array formula: =SUM(COUNTIF(C2:C10,{">50",">=100"})*{1,-1})
, three keys to end.
Second question: The picture below is a source data, E33, F33 are calculation conditions, complete the following questions.
1. Find the sum of the quantities corresponding to the cell values of model A04 and A03.
You can apply sumif (area, condition, summation area), and the formula is: =SUMIF(C22:G30,E33,D22:H30) SUMIF(C22:G30,F33,D22: H30), the result is: 745.
Or use the array formula: =SUM(SUMIF(C22:G30,E33:F33,D22))
, end with three keys.
2. Find the quantity corresponding to the cell values of models A04 and A03.
The basic principle of finding the number is the same as that of summation, but the functions are different. Therefore the formula is: =COUNTIF(C22:H30,E33) COUNTIF(C22:H30,F33)
or use the array formula =SUM(COUNTIF(C22:G30,E33 :F33))
, three keys to end.
3. Find the sum of the quantity of products whose model numbers start with A but do not include A03.
Both the SUMIF and COUNTIF functions support wildcard characters, and you can use wildcard characters, question marks (?) and asterisks (*) in conditions. A question mark matches any single character; an asterisk matches any string of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
Formula analysis:
Use the SUMIF function to find the total quantity starting with A. The formula is: =SUMIF(C22:G30,F33,D22)
, and then subtract the value of A03 from this value to get the value other than A03.
The formula is: =SUMIF(C22:G30,"A*",D22)-SUMIF(C22:G30,F33,D22)
, and the result is: 998.
Related learning recommendations: excel tutorial
The above is the detailed content of A brief analysis of the usage of sumif() and countif() in Excel function learning. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Go language provides two dynamic function creation technologies: closure and reflection. closures allow access to variables within the closure scope, and reflection can create new functions using the FuncOf function. These technologies are useful in customizing HTTP routers, implementing highly customizable systems, and building pluggable components.

In C++ function naming, it is crucial to consider parameter order to improve readability, reduce errors, and facilitate refactoring. Common parameter order conventions include: action-object, object-action, semantic meaning, and standard library compliance. The optimal order depends on the purpose of the function, parameter types, potential confusion, and language conventions.

1. The SUM function is used to sum the numbers in a column or a group of cells, for example: =SUM(A1:J10). 2. The AVERAGE function is used to calculate the average of the numbers in a column or a group of cells, for example: =AVERAGE(A1:A10). 3. COUNT function, used to count the number of numbers or text in a column or a group of cells, for example: =COUNT(A1:A10) 4. IF function, used to make logical judgments based on specified conditions and return the corresponding result.

The advantages of default parameters in C++ functions include simplifying calls, enhancing readability, and avoiding errors. The disadvantages are limited flexibility and naming restrictions. Advantages of variadic parameters include unlimited flexibility and dynamic binding. Disadvantages include greater complexity, implicit type conversions, and difficulty in debugging.

The benefits of functions returning reference types in C++ include: Performance improvements: Passing by reference avoids object copying, thus saving memory and time. Direct modification: The caller can directly modify the returned reference object without reassigning it. Code simplicity: Passing by reference simplifies the code and requires no additional assignment operations.

The key to writing efficient and maintainable Java functions is: keep it simple. Use meaningful naming. Handle special situations. Use appropriate visibility.

Exception handling in C++ can be enhanced through custom exception classes that provide specific error messages, contextual information, and perform custom actions based on the error type. Define an exception class inherited from std::exception to provide specific error information. Use the throw keyword to throw a custom exception. Use dynamic_cast in a try-catch block to convert the caught exception to a custom exception type. In the actual case, the open_file function throws a FileNotFoundException exception. Catching and handling the exception can provide a more specific error message.

The difference between custom PHP functions and predefined functions is: Scope: Custom functions are limited to the scope of their definition, while predefined functions are accessible throughout the script. How to define: Custom functions are defined using the function keyword, while predefined functions are defined by the PHP kernel. Parameter passing: Custom functions receive parameters, while predefined functions may not require parameters. Extensibility: Custom functions can be created as needed, while predefined functions are built-in and cannot be modified.
