ukcoalition.org
*Home>>>AIDS Information

Can MSExcel return some of the characters in cells based on the preceding characters?


for example:
if the sheet contains: CELLA2= "0/ABC/0/ACT/AID/N/2nd", CELLA3= "0/ZYXLQ/0/NRSG/RN/Tx/1st", etc
i want to 'count' the "/" and return the characters between the 4th and 5th "/"
I have tried to use the LEFT/RIGHT/MID functions but with the variable number of characters before & after the one's i am trying to get it meant manually editing the formulas, which is what i am trying to avoid.
for the example above, i would like to have "AID" in CELLB2 and "RN" in CELLB3, etc
If i have been unclear, please tell me what more information i can provide to clarify the matter. I hope this is possible!

your text is in cell A1 and my formula in cell B1
This formula will return anything between the 4th "/" and 5th "/"

how does it work?
the function substitute can change one character into another one.
So I decide to change the 4th "/" into a "\" and then thanks to the function SEARCH I know where my "\" is in your string of characters.
I do the same with the 5th "/" which I turn to a "\" and retrieve its position thanks to the search function
Knowing the position of the 4th "/" I know where to make the MID function start. Then as I know the position of the 5th "/" I can ask the MID function how many characters to retrieve (5th "/" position - 4th "/" position)

=MID(A1,SEARCH("\",SUBSTITUTE( A1,"/","\",4),1)+1,SEARCH( "\",SUBSTITUTE(A1,"/","\",5)) - (SEARCH( "\",SUBSTITUTE( A1,"/","\",4),1)+1))

NOTE 1: I added some extra spaces between the () to prevent Y Q/A from turning some parts of the formula into "..." When pasting the formula Excel should normally get rid of them. If it is not the case, you'll have to do it yourself.

NOTE 2: It is much easier with a macro. So if you don't bear any grudge against macros, let me know it, (email me through Y Q/A)

Tags
  AIDS Information   HIV AIDS   AIDS Drug   AIDS Research   AIDS Transmission   AIDS Cure   AIDS Treatment
Related information
  • Did cavemen have a version of theatre or performance of their own?

    It all took place around a fire :-)

    ...
  • I want a divorce but can't afford it financially.?

    legal aide society

    ...
  • I need HELP Picking a DOMAIN NAME FOR MY NEW BUSINESS.?

    If you follow the link I supplied you can enter groups of words that are then put into combinations. Select the one you like and see if you can register it.

    ...
  • I'm doing a Suicide project i need help....?

    Assisting in the death of someone by any means other than disconnecting life support machines is a crime.

    ...
  • How to lower cholesterol with supplements?

    garlic tablets oatmeal fiber pills

    ...
  • Where do i ask questions when pot holes in roads?

    Without knowing where you live, nobody can answer this for you. You need to check your local phone book for city offices, county offices, and your public library, who will help you find the right o...

  • Fish question?

    Salt really isn't usefully for 1st aid. It's really only useful for the following: 0)Treating ich, or velvet, but it's best to use salt inaddition to a medication. 1)Reduces nit...

  • What is the name of the clothing manufacturer that made the MLB jerseys that the 1990 Cincinnati Reds wore?

    I would say that Russell Athletics and Majestic were the manufacturers of Authentic On-Field jerseys and apparel for Major League Baseball. Nike only made replica jerseys for fashion and current...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster