How to verify cell contents as text vs number when numbers begin with 0/zero?

I want the following outcomes when a user enters a Supplier ID:

  • If the ID is an ID found in the reference sheet: Associated supplier name
  • If the ID is not an ID found in the reference sheet: "Check supplier ID"
  • If text is input: Text input

Here is my current formula - Issue is "ISTEXT" formula considers "000012345" as text and not a number. How do I alter so my formula can decipher true text from a supplier ID. All supplier IDs will have a varying amount of leading zeros.

=IF(AND([Supplier ID]@row = "", Status@row <> ""), "TBD", IFERROR(VLOOKUP([Supplier ID]@row, {Active Supplier List}, 2, false), IF(ISTEXT([Supplier ID]@row), [Supplier ID]@row, "CHECK SUPPLIER ID")))



  • brianschmidt
    brianschmidt ✭✭✭✭✭

    This may not be the most efficient but should work. In your reference sheet, I would create a helper column (called "Supplier ID Value") that has the following formula (column can be hidden once column formula is set):

    =IFERROR(VALUE([Supplier ID]@row), "")

    Then, in order to consider numbers that can in fact be considered "Values" as opposed to "Text", I would try your formula as such (using Index(collect instead) in the sheet where new Supplier IDs are going to be added:

    =IF(AND([Supplier ID]@row = "", Status@row <> ""), "TBD", IF(ISTEXT(IFERROR(VALUE([Supplier ID]@row), [Supplier ID]@row])), [Supplier ID]@row, INDEX(COLLECT({Active Supplier List-Supplier Name}, {Active Supplier List-Supplier ID Value}, VALUE([Supplier ID]@row)), 1), "CHECK SUPPLIER ID")))

    Hope this helps!:)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!