0
votes

I have a SharePoint calculated column that is as follows:

=RIGHT(Hip,LEN(Hip)-INT(FIND("-",Hip)))

Basically what this does is return the last digits after the "-" in a string, but for strings that do not contain a "-" it returns #Name? into the column. Does anyone know of an easy way to change this formula to make it say what I want? Or is it just easier to re-think the formula all together. Thanks guys.

2
What is the column type of 'Hip'? Was that column created with any special characters in the name? - Graham
The column type is just a single line of text, it has numbers and letters, and some have a hyphen, for example: B1155A1-5, and B1155A1 are both examples in the column. - user1689423
Did the column name 'Hip' ever have any special characters in it or has it always been 'Hip'? - Graham
Graham, the column is just a text column. Here is what it contains: Letters, numbers, maybe a hyphen. That is it. Nothing strange or weird going on here. Just a simple text column. - user1689423
Not the column type, the NAME for the column. Was it ever named something like 'Hip Column', 'Hip!', 'Hip_14_Data'. Errors around #name can be because there are special characters, the column doesn't exist or text that should be treated as a string is treated as a value (122 vs '122'). You can also try [Hip] vs Hip. - Graham

2 Answers

0
votes

You need to use an =IF() statement around this if you're using hyphens that may or may not be there. IF(check for hyphen, hyphen formula, non-hyphen formula), The MSDN information is here for the full docs.

0
votes

Thanks Graham, I appreciate your time. Your thoughts were definitely helpful! Here is the final solution -

=IF(ISNUMBER(FIND("-",Shipprod)),RIGHT(Shipprod,LEN(Shipprod)-INT(FIND("-",Shipprod))),"Not OK")