Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Google Sheets MAXIFS Function: Guide and Examples

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The MAXIFS function in Google Sheets returns the maximum value among cells that meet one or more specific criteria. To use it, you enter the range containing the numbers you want to evaluate, followed by pairs of criteria ranges and the conditions those ranges must meet. For example, =MAXIFS(A1:A10, B1:B10, "Complete") finds the highest number in A1:A10 where the corresponding cell in B1:B10 says "Complete".

What You'll Need

  • A Google account with access to Google Sheets.
  • A dataset containing at least one column of numerical values (the values you want to find the maximum of).
  • One or more columns of data that can be used as filters or criteria (e.g., dates, categories, names, or status indicators).

Step-by-Step

  1. Prepare Your Data: Ensure your data is organized in a table format. For the MAXIFS function to work correctly, your "max_range" (the numbers) and your "criteria_range" (the filters) must be the same size. If your number range is A2:A100, your criteria range must also span exactly 99 rows (e.g., B2:B100).
  2. Select the Target Cell: Click on the cell where you want the result of the maximum value to appear.
  3. Start the Formula: Type =MAXIFS( into the cell. This opens the function and prepares Google Sheets to receive the required arguments.
  4. Define the Max Range: Select the range of cells that contains the numbers you want to analyze. For example, if you are tracking sales figures in column C, highlight C2:C50. Type a comma to move to the next argument.
  5. Define the First Criteria Range: Select the range of cells that Google Sheets should check for your first condition. For example, if you want to find the max sale for a specific employee listed in column A, highlight A2:A50. Type another comma.
  6. Set the First Criterion: Enter the condition that must be met. You can do this in two ways:
    • Hard-coded: Type the value in quotation marks, such as "John".
    • Cell Reference: Click a cell that contains the name, such as E2. This is recommended for creating dynamic dashboards.
  7. Add Additional Criteria (Optional): If you need to filter by more than one condition (e.g., the max sale for "John" in the "North" region), repeat the process of selecting a criteria range and then entering the criterion. For example, add , B2:B50, "North".
  8. Close and Execute: Type the closing parenthesis ) and press Enter. Google Sheets will now scan the data and return the highest number that satisfies all the conditions you provided.

Common Mistakes

One of the most frequent errors is the mismatched range size. If your max_range is A2:A10 but your criteria_range is B2:B11, the formula will return an #N/A or #VALUE! error. The function operates by looking at the row index; if the ranges are not identical in height or width, the alignment breaks.

Another common mistake is incorrect syntax for logical operators. When using operators like "greater than" or "less than", they must be enclosed in double quotation marks. For example, writing >10 will cause a formula error; you must write ">10". If you are combining a logical operator with a cell reference, you must use the ampersand symbol to concatenate them, such as ">"&E2.

Users also frequently forget quotation marks around text strings. If your criterion is a word like "Pending", and you type it without quotes, Google Sheets will look for a named range called Pending rather than the text string, resulting in a #NAME? error.

Finally, some users confuse MAXIFS with MAX. The MAX function simply finds the highest number in a range regardless of any other factors. MAXIFS is specifically for conditional maximums. If you only have one range and no conditions, use MAX to keep your spreadsheet efficient.

Tips

To make your spreadsheets more professional and flexible, use cell references instead of hard-coded text. Instead of typing "January" into your formula, point the formula to a cell where you have a dropdown menu of months. This allows you to change the view of your data without editing the formula itself.

When dealing with dates, remember that dates are stored as numbers. You can use MAXIFS to find the most recent date that meets certain criteria. For example, to find the latest order date for a specific customer, set the max_range to the date column and the criteria_range to the customer name column.

If you need to find the maximum value based on a "not equal to" condition, use the <> operator. For example, "<>Completed" will find the maximum value for all rows that are not marked as completed.

For very large datasets, consider naming your ranges. Instead of using A2:A1000, you can highlight the column, right-click, and select "Define named range" to call it "SalesAmount". Your formula then becomes =MAXIFS(SalesAmount, Region, "West"), which is much easier to read and audit.

Troubleshooting

If your formula is not working as expected, start with these checks:

1. Check for #N/A or #VALUE! Errors: This almost always indicates that your ranges are different sizes. Double-check that the start and end row numbers are identical for every range mentioned in the formula.

2. Verify Data Types: Ensure that the range you designated as the "max_range" actually contains numbers. If the numbers are formatted as text (often indicated by a small green triangle or left-alignment in the cell), MAXIFS will ignore them, potentially returning 0.

3. Audit Your Criteria: If the formula returns 0 but you know a maximum exists, check for hidden spaces in your text. A cell containing "John " (with a trailing space) will not match a criterion of "John". Use the =TRIM() function on your data to remove accidental whitespace.

4. Test with a Single Criterion: If you have five different criteria and the formula is failing, remove four of them. Once the formula works with one criterion, add the others back one by one to identify which specific condition is causing the issue.

5. Check for Circular Dependencies: Ensure the cell where you are writing the formula is not inside any of the ranges the formula is referencing. If you put the formula in cell A10 and your range is A1:A10, you will create a circular dependency error.

Frequently Asked Questions

Can MAXIFS handle multiple conditions?

Yes, that is its primary purpose. You can add multiple pairs of criteria_range and criterion. The function will only return the maximum value for rows that satisfy every single condition provided (AND logic).

What happens if no cells meet the criteria?

If no cells in the range match the specified conditions, the MAXIFS function will return 0.

Can I use wildcards in MAXIFS?

Yes, you can use the asterisk (*) to match any sequence of characters or the question mark (?) to match any single character. For example, "North*" would match "North", "Northwest", and "Northeast".

Does MAXIFS work with dates?

Yes. Since Google Sheets treats dates as sequential numbers, you can use MAXIFS to find the latest date (the maximum number) that fits your criteria.

Is there a limit to how many criteria I can add?

While there is no strictly defined small limit, adding dozens of criteria can slow down the performance of your sheet. For extremely complex filtering, you might consider using the QUERY function instead.

Can I use MAXIFS to find the minimum value?

No, MAXIFS only finds the maximum. To find the minimum value based on criteria, use the MINIFS function, which uses the exact same syntax and logic as MAXIFS.