Skip to content

MAXA

Returns the largest value in a set, counting TRUE as 1 and text or FALSE as 0 where MAX would ignore them.

Syntax

=MAXA(, [value2], ...)

Statistical

All versions of Excel.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
D
1
Reading
MAXA
2
-4
0
3
n/a
4
-9
5
6

C2 =MAXA(A2:A4) returns 0

How MAXA works

MAXA returns the largest value in a set, like MAX, but it takes text and logical values into account. In a range, TRUE counts as 1, and text and FALSE count as 0. MAX ignores all of those. That difference rarely matters for clean numeric data, but it can change the answer when your range holds flags, "n/a" labels or other text.

How values are counted

For values inside a cell reference or range:

  • Numbers: used as they are.
  • TRUE: counted as 1.
  • FALSE: counted as 0.
  • Text: counted as 0, even text that looks like a number.
  • Empty cells: ignored.
  • Errors: passed through, so one #DIV/0! in the range gives #DIV/0!.

For values typed straight into the function, such as MAXA("5",-2), text that can be read as a number is converted, so that example returns 5. Text that can't be read as a number returns #VALUE!.

Where it gives a different answer

For a range holding -4, "n/a" and -9, MAX returns -4 because it ignores the text. MAXA counts "n/a" as 0 and returns 0. A range that holds -5, TRUE and -1 gives MAX of -1, but MAXA of 1 because TRUE counts as 1.

The difference works in the other direction too. If every value in a range is text, MAX returns 0 and MAXA returns 0, but for different reasons.

When to use it

Use MAXA when logical values or text placeholders are meaningful data and you want them counted. A column of TRUE and FALSE flags is the clearest case: =MAXA(C2:C20) returns 1 if any flag is TRUE and 0 if none are. That makes MAXA a compact "any" test.

When to use MAX instead

In most reports, a text note in a numeric column is noise, not a zero. A temperature log with the word "fault" in one row should usually report the highest real reading, which is what MAX does. Choose MAX unless you specifically need logicals or text to count.

Related functions

MIN is the counterpart to MAX, and AVERAGEA is the AVERAGE version that counts text as 0 and TRUE as 1. MAXIFS returns the maximum under conditions and, like MAX, ignores text.

Arguments

value1
The first value, cell reference or range to examine.
value2, ...optional
Further values, cells or ranges, up to 255 arguments in all.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Text counts as zero

C2 =MAXA(A2:A4)

Result: 0

The text "n/a" counts as 0, which is larger than -4 and -9. MAX would return -4.

C2
A
B
C
D
1
Reading
MAXA
2
-4
0
3
n/a
4
-9
5
6

C2 =MAXA(A2:A4) returns 0

Example 2

TRUE counts as 1

C2 =MAXA(A2:A4)

Result: 1

TRUE counts as 1, so it is the largest value. MAX would return -1.

C2
A
B
C
D
1
Value
MAXA
2
-5
1
3
TRUE
4
-1
5
6

C2 =MAXA(A2:A4) returns 1

Example 3

Any flag set

C2 =MAXA(A2:A5)

Result: 1

One TRUE in the range makes the result 1. If every flag were FALSE the result would be 0.

C2
A
B
C
D
1
Alert
Any alert?
2
FALSE
1
3
FALSE
4
TRUE
5
FALSE
6
7

C2 =MAXA(A2:A5) returns 1

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In E2, return the warmest (highest) real temperature reading in B2:B6, ignoring the text entry.

Answer in E2.

E2
A
B
C
D
E
1
Day
Freezer temp (C)
Door alarm
Warmest reading
2
Mon
-18
FALSE
3
Tue
-20
FALSE
4
Wed
fault
TRUE
Any alarm
5
Thu
-19
FALSE
6
Fri
-21
TRUE
7
8

Common mistakes

  • MAXA counts text as 0. In a column of negative numbers with a text note, the answer becomes 0.
  • In a range, TRUE is 1 and FALSE is 0. Numbers stored as text count as 0, not as their number.
  • An error in the range makes MAXA return that error.
  • For ordinary numeric columns use MAX. It ignores text and logicals.

Questions people ask

What is the difference between MAX and MAXA?

MAX ignores text and logical values in ranges. MAXA counts TRUE as 1 and text and FALSE as 0.

Why is MAXA returning 0 for a column of negative numbers?

The column probably contains text, such as a note. MAXA counts text as 0, which beats the negative values. Use MAX to ignore the text.

How do I check whether any value in a TRUE or FALSE column is TRUE?

`=MAXA(range)=1` returns TRUE if any flag is TRUE. `=OR(range)` is a more direct choice.

Does MAXA count empty cells?

No. Empty cells are ignored, like they are in MAX.

Learn MAXA in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.