Attempting to use INDEX function for the first time

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
I've got 2 worksheets with company names/addresses and the codes associated with them.

They are set up as follows:
Book1
ABCD
1CodeCompanyName/AddressBillto
2AMT2Dummyco. 100ABCSt. Here,OH12345Same
3MOI2TestProducts 5026thSt. There,IL12345Same
4BWP6Made-upInc. 9003KingSt. Everywhere,NY12345Dummyco. 100ABCSt. Here,OH12345
Sheet1


One worksheet is domestic companies, the other international.

I'm attempting to make a separate index page from the other 2 sheets, but instead of typing everything out, I figured I'd try this.

What I want to get is just the code, company name (no address), company location (no address or zip), and whatever is under bill to.

I've got the initial index function to work, however, I'm stuck on how to get just the company name or city/state-city/country from the one cell. Or even if I can, for that matter.

Any ideas? Or should I just start entering it all "by hand?"

Thanks,
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Thanks for the help, guys.

Unfortunately, I'll have to wait and try them tomorrow.

Either way, I'll let you know how it turns out :)
 
Upvote 0
Ok. Here we go again.

Doing better this time, though.

Aladin: I couldn't seem to get yours to work. Not to sound like we're "breaking up" or anything but, it's not you, it's me. :)

Yogi: While I don't quite understand how the formula is working, it seems to work great except for the one to pull out the location. I keep getting a #Value error after I change the B3 to the correct starting cell which is Domestic!$B4. It worked great on pulling out just the name, however.

Any ideas?
 
Upvote 0
Hi Kristy:

I have used your worksheet name Domestic and started my CompanyNameAddress in cell B4 in the following simulation ...
y030326h1.xls
ABCDEFG
1
2
3CodeCompanyNameAddressBillToCompanyNameCompanyLocationBillTo
4AMT2DummyCo. 100ABCSt. Here,OH12345SameDummyCo.Here,OHSame
5MOI2TestProducts 5026thSt. There,IL12345SameTestProductsThere,ILSame
6BWP6Made-upInc. 9003KingSt. Everywhere,NY12345Made-upInc. 9003KingSt. Everywhere,NY12345Made-upInc.Everywhere,NYMade-upInc. 9003KingSt. Everywhere,NY12345
Domestic


The formula for the CompanyLocation in this simulation is essentially the same as in my last post except for inclusion of sheet name Domestic -- I have however also used the CLEAN function to clean up any non-printing characters (such as the ALT+RETURN used in our CompanyNameAddress field).

So, the CompanyLocation bit should also have worked with the formulas in my earlier post. However, please try the modified formula in this post. You are welcome to email me your file -- I have sent you my email address in a PM to you.
 
Upvote 0
Von Pookie said:
Ok. Here we go again.

Doing better this time, though.

Aladin: I couldn't seem to get yours to work. Not to sound like we're "breaking up" or anything but, it's not you, it's me. :)
[...]
Any ideas?

Want me to send you a WB housing WMID formulas? If yes, you need to install themorefunc.xlladd-in.
 
Upvote 0
Yogi: For some reason, I'm getting a Javascript error on the page and can't see all of the formulas. I can see the one for E4, but it's not working for the rest of them :-?

Aladin: I did download the morefunc thing you mentioned. Actually, I used the link from your signature. It's installed and everything, I'm just too stupid to figure out how you got the formulas to work :-?
 
Upvote 0
Edit: After receiving your workbook, I corrected the formula for CompanyLocation (as shown below)

Hi Kristy:

The formulas I have in my post are as follows ...

CompanyName:
'=LEFT(Domestic!$B4,FIND(CHAR(10),Domestic!$B4)-1)

CompanyLocation:
'=LEFT(MID(Domestic!$B4,FIND("~",SUBSTITUTE(Domestic!$B4,CHAR(10),"~",LEN(Domestic!$B4)-LEN(SUBSTITUTE(Domestic!$B4,CHAR(10),""))))+1,255),FIND(",",MID(Domestic!$B4,FIND("~",SUBSTITUTE(Domestic!$B4,CHAR(10),"~",LEN(Domestic!$B4)-LEN(SUBSTITUTE(Domestic!$B4,CHAR(10),""))))+1,255))+3)

I hope this helps!
 
Upvote 0
Hi Kristy:

Here is the simulation with the updated formula for the CompanyLocation ...
y030326h1.xls
ABCDEFG
1
2
3CodeCompanyNameAddressBillToCompanyNameCompanyLocationBillTo
4AMT2AMTEX 1500KingswayDr. Lebanon,OH12345SameAMTEXLebanon,OHSame
5MOI2TestProducts 5026thSt. There,IL12345SameTestProductsThere,ILSame
6BWP6Made-upInc. 9003KingSt. Everywhere,NY12345Made-upInc. 9003KingSt. Everywhere,NY12345Made-upInc.Everywhere,NYMade-upInc. 9003KingSt. Everywhere,NY12345
7MA10Bridgestone/Firestone,Inc TechnologyCompany 1600FirestonePkwy. Akron,OH77317-0001MM35Bridgestone/Firestone,IncAkron,OHMM35
Domestic


I hope all is well now!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top