Sharepoint calculated column returning #Name? - sharepoint

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.

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.

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")

Related

Extract information before several special characters in excel

I have a problem with an excel file.
I am trying to extract information from a column. This information appears randomly, before a ".", "-" or ":". So an example would be:
CELL
EXPECTED RESULT
hi.this is:
hi
maybe I- this works
maybe I
Who is: what. like-
Who is
I am using the formula:
=MID(A1,1,FIND("-",A1,1)-1)
Using this one, I get the information I need, but I am not able to add the other characters (".", ":",...) to the formula. Also I have the problem that in a same cell, I can have several of this characters, and I only want the information before the FIRST character (of all posible kinds) that appears in the cell.
I dont know if somebody can help me here.
Thank you very much in advance!
You can try:
Formula in B1:
=TEXTBEFORE(A1:A3,{".","-",":"})
If you don't yet have acces to TEXTBEFORE() then try:
=LEFT(A1,MIN(FIND({".","-",":"},A1&".-:"))-1)
I suppose this is an array-entered formula in versions prior to ms365.

Extract Specific Value from Cell in Excel

I have a work dilemma. I have some cells, too many to manual work, that have some combination of the below:
"grievance 01-11 filed 09/19/02"
I am hoping to get only the "01-11" or whatever combination of xx-xx from the cell. I have used =LEFT(R102,FIND("-",R102)-1), but it gives me everything before/after the dash.
Thank y'all for any assistance!
Use SEARCH:
=MID(R102,SEARCH("??-??",R102),5)

Excel - CountIfs (column A has target value, column B is blank)

First post, sorry if it's not according to site preferences. I searched around and couldn't find a post that was exactly like this, but sorry if this is a repeat as well.
I have the following code:
=COUNTIFS(A:A,"="&C3, B:B,"<>""")
For clarity, the code is supposed to identify instances where column A has a specific value (C3), and where column B is empty.
I'm familiar with Countifs, but it was the "if blank" portion that I've been really struggling with. On top of that, column B is populated with formulas, making this seemingly more challenging from my perspective as a couple methods I've tried only work if the cells are truly unpopulated. What I can say is that this formula is working with almost all of my examples, except 1, and I have no idea why this would be. For that matter I'm not entirely sure why this code works at all.
Any insight would be greatly appreciated.
Thank you very much.
To count if blank: "="
=COUNTIFS(A:A,"="&C3, B:B,"=")
Or if this is easier to understand:
=COUNTIFS(A:A,"="&C3, B:B,"=" & "")
Which is the same.
"=" in COUNTIFS does not match blanks that result from formulas. Dont ask me why!
As workaround, you can use the flexible and never vexing SUMPRODUCT:
=SUMPRODUCT((A:A=C3)*(LEN(B:B)=0))

Removing hyphens from a cell in Excel

I am looking to take the hyphen or dash out of a birthdate.
01/01/01
01-01-01
I need to combine the birthdate with other fields and it can't have the seperator in it.
I am sure there is a better way. I can get the month and year out, using left & right however I can't figure out how to get the middle out. Below is what I have so far and I know that I can combine them using "&"...if someone can help me with the middle or give me a better equation I would appreciate it.
LEFT(A1,2)
RIGHT(A1,2)
Solution:
=LEFT(F2,2)&MID(F2,4,2)&RIGHT(F2,4)
if it is a string, (not formated as a date) then you can use
MID(A1,4,2)
otherwise i just use the MONTH(A1) DAY(A1) YEAR(A1) functions
I'm not sure what an excel formula is so this answer might be irrelevant...
VBA has a Mid function that would do what you want I believe. This page has good explanations for that and the other similar functions: http://www.vbtutor.net/VBA/vba9.htm
You could also do a Find and Replace to replace the "-" with nothing.
Ctrl + H will bring up the Replace dialog box.
Change the number format of the date to something line "mmddyy". To combine it with other text in another cell, use a formula like:
="The date is "&TEXT(A1,"mmddyy")
where the date is in cell A1.

Removing parts of a cell

In Excel, how do I write a formula that will partially delete a cell (from a certain point onwards).
For example, if A1 is "23432 Vol 23432". I want B1 to just be "23432 " (everything from Vol onwards is removed). Thanks.
you cannot delete cells with formulas in Excel.
you can modify the content of a cell by using formulas. you may use LEFT(), RIGHT(), MID() and other similar string processing functions.
is there any rule about the number? If for example the number is always 5 digits long, you can return "23432" out of "23432 Vol 23432" by typing =LEFT(A1;5)
you might also want to look for the space. think the english equivalent for the german FINDEN-function is FIND(keyword;text;[first charindex]). if splitting by space, you find the number by =LEFT(A1;FIND(" ";A1))
please post detailed information about your problem if you need further assistance.
EDIT: you may also use VBA if your problem needs a custom formula or custom actions taken out on a cell.
EDIT2, SOLUTION:
=LEFT(A1;FIND(" Vol";A1))
is the solution to your problem, iff "Vol" and the rest needs to be removed in any case without condition. Remember that if you have any condition attached to this, you might nest this expression (without the '=' though) in a "IF()"-formula.
hope that helped you.
best regards

Resources