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,
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
This formula worked for me:

=LEFT(A1,FIND("
",A1)-1)


In the FIND portion, it is " then ALT+ENTER then " again.
 
Upvote 0
But how can I implement that in the index function?

I think what may be confusing me is that I'm not using a specific cell address like you did with the LEFT function. The formula I'm using to populate the cells is =INDEX(Domestic!$A$4:$C$49,1,2,1)

I'm just plain lost, apparently :-?
 
Upvote 0
I can't get HTML Maker to work on this one, but here's the formula I used to create the data you need:

=A1& " " & LEFT(B1,FIND("
",B1)-1) & " " & LEFT(RIGHT(B1,LEN(B1)-FIND("
",B1,FIND("
",B1)+1)),LEN(RIGHT(B1,LEN(B1)-FIND("
",B1,FIND("
",B1)+1)))-7) & " " & LEFT(C1,FIND("
",C1)-1)


In the FIND functions, the "" is actually " ALT+ENTER "
 
Upvote 0
:o

Totally, completely and utterly lost.

:evil: !#%*&@$!

And I couldn't get your formula to work, either.

I'm going to take a little break from this for like...5 minutes, then come back and kick the machine some more because I'm too stupid to figure this out. :x
 
Upvote 0
Von Pookie said:
:o

Totally, completely and utterly lost.

:evil: !#%*&@$!

And I couldn't get your formula to work, either.

I'm going to take a little break from this for like...5 minutes, then come back and kick the machine some more because I'm too stupid to figure this out. :x

Kristy,

I'm lost too. I can't still figure out why you use INDEX. That formula cannot be dragged. It just includes some constants to fetch a value. Are you looking for something like this...
Book6
ABCDEFGHI
1CodeCompanyName/AddressBilltoCompanyLocation
2AMT2Dummyco. 100ABCSt. Here,OH12345SameMOI22TestProductsThere
3MOI2TestProducts 5026thSt. There,IL12345Same
4BWP6Made-upInc. 9003KingSt. Everywhere,NY12345Dummyco. 100ABCSt. Here,OH12345
Sheet1


The formulas are...

F2:

=MATCH(E2,$A$2:$A$5,0)

G2:

=IF(ISNUMBER(F2),WMID(INDEX($B$2:$B$4,F2),1,1,CHAR(10)),"")

H2:

=IF(ISNUMBER(F2),WMID(WMID(INDEX($B$2:$B$4,F2),3,1,CHAR(10)),1,1,","),"")

Aladin

PS. WMID requires the morefunc.xll add-in.
 
Upvote 0
Aladin Akyurek said:
Kristy,

I'm lost too. I can't still figure out why you use INDEX.

Because I rarely, if ever, do anything "advanced" like this, and don't know any better. :oops: I'm a big formula dummy. Basic usage, check. Some very, very rudimentary knowledge of VBA, check. But no one thing :)

But I'll give yours a go
 
Upvote 0
Aladin's looks much cleaner, but since I started this debacle, I'm postin' it! Below you will find a very good example of how not to approach this (too many lookups).
Book3
ABCDE
1FullFormulae
2CodeFullBlockLine1Line2Line3
3AMT2Dummyco. 100ABCSt. Here,OH12345Dummyco.100ABCSt.Here,OH
4MOI2TestProducts 5026thSt. There,IL12345TestProducts5026thSt.There,IL
5
6LookUps
7CodeCo.AddressLocation
8AMT2Dummyco.100ABCSt.Here,OH
9MOI2TestProducts5026thSt.There,IL
Sheet2


All native, no Longre assistance required (which is not inherently good). Oh, and no #n/a trap either... Like I said, not good.
 
Upvote 0
Aladin? I'm still a little confused. What is the MATCH function doing and why?

I understand that the other formulas are based off of this, but the page I want to make is starting out entirely blank. I don't have a "lookup value" to go off of. It looks like you've got the right idea of what I want to do, though.

This has already been more trouble than it's worth, but on the other hand, it doesn't hurt to try new stuff :)

Edit: Nate, you snuck in there on me. You have to remember, though: your "not good" is WAY better than anything I could even dream up. :)
 
Upvote 0
Von Pookie said:
Aladin? I'm still a little confused. What is the MATCH function doing and why?

I understand that the other formulas are based off of this, but the page I want to make is starting out entirely blank. I don't have a "lookup value" to go off of. It looks like you've got the right idea of what I want to do, though.

This has already been more trouble than it's worth, but on the other hand, it doesn't hurt to try new stuff :)

I assume that you have the addresses along with codes somewhere. Just list (with copy/paste if there are no duplicates) in the destination area and use the codes as lookup values (as my exhibit shows) to rip off the addresses you bring over with INDEX/MATCH combination. MATCH computes the row (position) of a given code in the source. INDEX picks up the address at the same position from the address range as the code it's associated with. The foregoing assumes that the source and the destination areas will be in different sheets. If not, you can apply the WMID formulas directly to the address cells (No need for INDEX/MATCH). Too much 'Greek'? :(
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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