Math & Trig
All versions
◉ 9 views
=SUMIF()
How to use the SUMIF function in Excel to add the values in a range that meet criteria that you specify.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=SUMIF(range, criteria, [sum_range])
Hover argument names in the table for details.
Output typeNumber
Popularity60 / 100
VolatileNo
Dynamic ArrayNo
📥 Download sample .xlsx — Coming soon
▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =SUMIF() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
🧠 🧠 Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
rangeRequired |
Date | Optional | . The range of cells that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored. The selected range may contain dates in standard Excel format (examples below). |
criteriaRequired |
Text | Required | . The criteria in the form of a number, expression, a cell reference, text, or a function that defines which cells will be added. Wildcard characters can be included - a question mark (?) to match any single character, an asterisk (*) to match any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character. For example, criteria can be expressed as 32, ">32", B5, "3?", "apple*", "*~?", or TODAY(). Important Any text criteria or any criteria that includes logical or mathematical symbols must be enclosed in double quotation marks ("). If the criteria is numeric, double quotation marks are not |
sum_rangeOptional |
Range | Optional | . The actual cells to add, if you want to add cells other than those specified in the range 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). Sum_range should be the same size and shape as range. If it isn't, performance may suffer, and the formula will sum a range of cells that starts with the first cell in sum_range but has the same dimensions as range. For example: range sum_range Actual summed cells A1:A5 B1:B5 B1:B5 A1:A5 B1:K5 B1:B5 |
▣ Examples
مجموع کمیسیونهای مربوط به ارزش ملکهای بالای ۱۶۰٬۰۰۰ دلار
=SUMIF(A2:A5,">160000",B2:B5)
مجموع ارزش ملکهای بالای ۱۶۰٬۰۰۰ دلار
=SUMIF(A2:A5,">160000")
مجموع کمیسیونهای مربوط به ارزش ملک برابر ۳۰۰٬۰۰۰ دلار
=SUMIF(A2:A5,300000,B2:B5)
مجموع کمیسیونهای مربوط به ارزش ملکهای بزرگتر از مقدار سلول C2
=SUMIF(A2:A5,">" & C2,B2:B5)
مجموع فروش همه مواد غذایی در دسته «Fruits»
=SUMIF(A2:A7,"Fruits",C2:C7)
مجموع فروش همه مواد غذایی در دسته «Vegetables»
=SUMIF(A2:A7,"Vegetables",C2:C7)
مجموع فروش همه مواد غذایی که نامشان به «es» ختم میشود (Tomatoes، Oranges و Apples)
=SUMIF(B2:B7,"*es",C2:C7)
مجموع فروش همه مواد غذایی که دستهبندی ندارند
=SUMIF(A2:A7,"",C2:C7)
✦ Tips
- If you want, you can apply the criteria to one range and sum the corresponding values in a different range. 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." To sum cells based on multiple criteria, see SUMIFS function.
- The SUMIF function returns incorrect results when you use it to match strings longer than 255 characters or to the string #VALUE!.
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!