1

I want to remove all the characters from a string expect whatever character is between a certain set of characters. So for example I have the input of Grade:2/2014-2015 and I want the output of just the grade, 2.

I'm thinking that I need to use the FIND function to grab whatever is between the : and the / , this also needs to work with double characters such 10 however I believe that it would work so long as the defining values with the FIND function are correct.

Unfortunately I am totally lost on this when using the FIND function however if there is another function that would work better I could probably figure it out myself if I knew what function.

2
  • Does every record start with "Grade:"? Commented Jul 23, 2014 at 14:34
  • Yes, every record will follow the same format Commented Jul 23, 2014 at 14:37

3 Answers 3

2

It's not particularly elegant but =MID(A1,FIND(":",A1)+1,FIND("/",A1) - FIND(":",A1) - 1) would work.

MID takes start and length,FIND returns the index of a given character.

Edit: As pointed out, "Grade:" is fixed length so the following would work just as well: =MID(A1,7,FIND("/",A1) - 7)

Sign up to request clarification or add additional context in comments.

1 Comment

+1 most dynamic answer although could immediately substitute the Grade: which is static
1

You could use LEFT() to remove "Grade:"

And then use and then use LEFTB() to remove the year.

Look at this link here. This is the way I would go about it.

Comments

0

=SUBSTITUTE(SUBSTITUTE(C4, "Grade:", ""), "/2014-2015", "")

where C4 is the name of your cell.

6 Comments

I think you forgot to attach the screenshot however I do need this to be formula because the data will change and I want it to output the grade automatically.
Thank you very much! I also learned a new function today haha
No problem, mark the answer as right so the question doesn't appear in the unanswered questions anymore.
this will not work when the year changes to 2015-2016 and / or you are using past year ranges.
citation: Yes, every record will follow the same format
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.