# INDEX the cell after the "/"

#### William Benton

##### New Member
I have a formula that returns what is in a certain cell in column B.

I want the formula to see if there is a "/" in the cell (column B) and if so check for "/" and return what is to the right of "/" and if not return what is in the cell.

This one catches the first "I" - the formula is:

=IF(COUNTIF(SCHEDULE!\$F\$5:\$F\$29,"I")>=ROWS(\$1:1),INDEX(SCHEDULE!B9:B29,SMALL(IF(SCHEDULE!\$F\$5:\$F\$29="I",ROW(\$1:\$25)),ROWS(\$1:1))),"")

If this could be reduced I am all ears.

I don't see if I can attach a sample anywhere.

Bill

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

#### FDibbins

##### Well-known Member
A bit confused here :?

Your request says to test for / but your formula is looking for I? So which 1 do you want?
Also, doing the formula that way, you need to keep the ranges the same size...\
=IF(COUNTIF(SCHEDULE!\$F\$5:\$F\$29,"I")>=ROWS(\$1:1),INDEX(SCHEDULE!B9:B29,SMALL(IF(SCHEDULE!\$F\$5:\$F\$29="I",ROW(\$1:\$25)),ROWS(\$1:1))),"")

I would modify that to this...
=IFERROR(IDEX(SCHEDULE!\$B:\$B,SMALL(IF(SCHEDULE!\$F\$5:\$F\$29="I",ROW(\$F\$5:\$F\$25)),ROWS(\$1:1))),"")

#### William Benton

##### New Member
A bit confused here :?

Your request says to test for / but your formula is looking for I? So which 1 do you want?
Also, doing the formula that way, you need to keep the ranges the same size...\
=IF(COUNTIF(SCHEDULE!\$F\$5:\$F\$29,"I")>=ROWS(\$1:1),INDEX(SCHEDULE!B9:B29,SMALL(IF(SCHEDULE!\$F\$5:\$F\$29="I",ROW(\$1:\$25)),ROWS(\$1:1))),"")

I would modify that to this...
=IFERROR(IDEX(SCHEDULE!\$B:\$B,SMALL(IF(SCHEDULE!\$F\$5:\$F\$29="I",ROW(\$F\$5:\$F\$25)),ROWS(\$1:1))),"")

Thankyou!

#### Rick Rothstein

##### MrExcel MVP

I have a formula that returns what is in a certain cell in column B.

I want the formula to see if there is a "/" in the cell (column B) and if so check for "/" and return what is to the right of "/" and if not return what is in the cell.
Give this formula a try...

=TRIM(LEFT(RIGHT(SUBSTITUTE("/"&B2,"/",REPT(" ",400)),400),400))

#### William Benton

##### New Member
Give this formula a try...

=TRIM(LEFT(RIGHT(SUBSTITUTE("/"&B2,"/",REPT(" ",400)),400),400))

Thank you Rick!

#### William Benton

##### New Member
Thankyou!

I look for the "I" to return what is in column B. Trouble is what is in B could either be one name or two names separated by "/". If separated by the "/" I want to return what is to the right of it and if no "/" just return the name.

Sorry for the late reply. Thanks for helping.

#### FDibbins

##### Well-known Member
Could you give some samples?

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

### Forum statistics

1,167,748
Messages
5,855,442
Members
431,733
Latest member
bestassignmentexpert789

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back