I have researched a lot, and couldn't figure this out. I have written an extremely long Nested If statement. The last piece to the puzzle follows (The bolded part obviously isn't close to a formula, but I was struggling to build the logic behind that):
IF((**F85 contains any characters that are NOT "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "-"**),1,0)
I am looking for an IF statement that returns a 1 or 0 if any character in cell F85
is not a number or dash. For example:
- 12345-12345 would return a 1
- 1234512345 would return a 1
- ---------- would return a 1
- 12345/12345 would return a 0
- 12345a12345 would retun a 0
- abc123 would return a 0
- abc-123 would return a 0
This is NOT relevant so ignore, but to show I've made some progress, this is my NestedIF so far, but I just need the last piece to the puzzle (no need to combine above formula with my NestedIf - I can take it from there):
=IF(OR(F85="None",F85=""),"00000-00000",IF(ISTEXT(SEARCH("-",F85)),F85,(IF(AND(LEN(F85)<=10,ISTEXT(SEARCH("-",F85)))="FALSE",LEFT(TEXT(F85,"0000000000"),5)&"-"&RIGHT(TEXT(F85,"0000000000"),5),F85))))
Thank you, this is the final part of a long macro that I've written, so it is very much appreciated if you can help.