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.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 444 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!