# 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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

#### 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?

Replies
6
Views
284
Replies
2
Views
377
Replies
2
Views
458
Replies
4
Views
754
Replies
6
Views
682

1,130,119
Messages
5,640,219
Members
417,131
Latest member
Seanr19871

### 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