Spreadsheet Practice

Why does IF say a number stored as text is greater than 100?

Formula (Excel and Google Sheets)

=IF(--B2>=$F$1,"Bulk","Standard")

Text always ranks above numbers in a comparison. Convert first: =IF(--B2>=$F$1,"Bulk","Standard").

Result on the example
one result per row in C2, filled down to C7
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in C2, filled down to C7. Change any input and the result updates, or edit the formula to experiment.

How it works

When a comparison mixes text and a number, Excel ranks every text value above every number, so "99" >= 100 is TRUE and the imported quantities all look large. The double minus turns the text into a number first, so the comparison is between numbers.

=IF(--B2>=$F$1,"Bulk","Standard")

Result"Bulk"

  1. B2"150"

    The value in B2.

  2. -B2-150

    Makes the value negative.

  3. --B2150

    Makes the value negative.

  4. $F$1100

    The value in F1.

  5. --B2>=$F$1TRUE

    The >= operator tests at least.

  6. IF(--B2>=$F$1,"Bulk","Standard")"Bulk"

    IF: Returns one value if a test is true, another if false.

    • logical_test--B2>=$F$1TRUE
    • value_if_true"Bulk"
    • value_if_false"Standard"not used

In Google Sheets

The same formula works in Google Sheets: =IF(--B2>=$F$1,"Bulk","Standard"). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(VALUE(B2)>=$F$1,"Bulk","Standard")Bulk, Standard, Standard…VALUE does the same conversion.
=IF(B2>=$F$1,"Bulk","Standard")Bulk, Standard, Bulk…Different resultWithout converting, text compares as larger than any number. "99" and "40" are labeled Bulk.

Common mistakes

  • Real numbers pass through -- unchanged, so the formula works on a mixed column.
  • Text that isn't a number, like "n/a", makes -- return #VALUE!.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Why does IF say a number stored as text is greater than 100

In C2, show "Bulk" when the quantity is at least the amount in F1, otherwise "Standard", treating quantities stored as text as numbers. Fill down to C7.

Questions

How do I find the numbers stored as text?

=ISTEXT(B2), or look for left-aligned numbers with a green triangle.

Do SUM and MAX have the same problem?

They skip text numbers instead of ranking them high, so totals come out too low.

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.