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")))
Thanks
Answers
-
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
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.9K Get Help
- 377 Global Discussions
- 207 Industry Talk
- 440 Announcements
- 4.5K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 289 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!