LEFT Function
I want to add a "0" to the left of any number with just 5 digits and just duplicate any number with "H" in front.
Best Answer
-
Ok. Let's try this instead:
=IF(LEFT([Column2]@row) = "H", [Column2]@row, "0" + [Column2]@row)
Answers
-
Try something like this...
=IF(LEN([Column2]@row) = 5, "0") + [Column2]@row
-
That works great for the example I provided. One exception and rather important that I failed to list, a standard five digit number could have an extension, like "XA", ie.45232XA, making length 7. I was working with contains to duplicate when includes a "H". Thank you for the quick reply.
-
Ok. Let's try this instead:
=IF(LEFT([Column2]@row) = "H", [Column2]@row, "0" + [Column2]@row)
-
Thank you Paul, I added the OR and it seems to work for all
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!