how to extract three consecutive numerals

I have made it work but is cumbersome and not entirely accurate as I have had to add tildes or apostrophes to the front of some equipment to get the desired outputs

The equipment ID column contains ID's that contain what is called a UPN which consists of three consecutive numerals. I want to extract those numerals for use in identifying project disciplines, responsible parties etc. while the numerals always come prior to a dash the number of characters and their makeup prior to them are not consistent. I am not worried about the electrical components as I have a column just for them as they contain a code within them to identify them which is matched to the UPN.

Sample Data

image.png

I am using trial and test columns to attempt to get this out the issue I have is I cannot get rid of the errors I receive and can only get the numbers for the first dash not the second

formula from Test column

=IF(AND(FIND("-", [Equipment ID]@row) > 3, ISNUMBER(VALUE(MID([Equipment ID]@row, FIND("-", [Equipment ID]@row) - 3, 3)))), MID([Equipment ID]@row, FIND("-", [Equipment ID]@row) - 3, 3), IFERROR(IF(AND(FIND("-", [Equipment ID]@row, FIND("-", [Equipment ID]@row) + 1) > 3, ISNUMBER(VALUE(MID([Equipment ID]@row, FIND("-", [Equipment ID]@row, FIND("-", [Equipment ID]@row) + 1) - 3, 3)))), MID([Equipment ID]@row, FIND("-", [Equipment ID]@row, FIND("-", [Equipment ID]@row) + 1) - 3, 3), ""), "TEST"))

formula from trial column

=IF(AND(FIND("-", [Equipment ID]@row) > 3, ISNUMBER(VALUE(MID([Equipment ID]@row, FIND("-", [Equipment ID]@row) - 3, 3)))), MID([Equipment ID]@row, FIND("-", [Equipment ID]@row) - 3, 3), IFERROR(MID([Equipment ID]@row, FIND("-", [Equipment ID]@row, FIND([Equipment ID]@row) + 1) - 3, 3), "test"))

would love to have this all work together and if possible add the electrical formula to it as well

electrical formula

=IFERROR(IF([Power Type]@row = "C", "605 Continuous Power", IF(AND([UPN3]@row > 100, Heirarchy@row > 5), INDEX({Metadata - UPN & UPI List 'Sys Name'}, MATCH([UPN3]@row, {Metadata - UPN & UPI List 'UPN'}, 1)), IF(CONTAINS("-HT", [Equipment ID]@row), "610 Heat Trace", IF([Power Type]@row = "E", "604 Emergency Power", IF(AND([Power Type]@row = "N", Heirarchy@row > 2), INDEX({Metadata - UPN & UPI List 'Volts"}, MATCH([Voltage identifier]@row, {Metadata - UPN & UPI List 'Voltage'}, 0)), IF(AND([Power Type]@row = "X", Heirarchy@row > 2), INDEX({Metadata - UPN & UPI List 'Volts"}, MATCH([Voltage identifier]@row, {Metadata - UPN & UPI List 'Voltage'}, 0)), "")))))), "")

thanks in advance for the assistance

Best Answer

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!