You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using Index and Match in Numbers

Hi all! A Numbers/spreadsheet newbie here. I have a specific task for which I am unable to frame the right 'Formula' question. Any help will be greatly appreciated.


Sheet 1)

User uploaded fileUser uploaded fileUser uploaded file

Sheet 2)

User uploaded file


What I am trying to achieve here is to set up an automatically updating mutual fund database which will derive prices from the web and insert into my worksheet, so that I can see my finances if I want to.


The first sheet is the raw data from the information provider, split into columns. The second sheet is my portfolio. Each item in the portfolio has a specific ISIN number to identify it and which correlates with the same (Column B in Sheet 1 and 2). I want run the query that each ISIN number in sheet 2 is able to find its counterpart in sheet 1 and then produce the data required from columns E and F in sheet 1 and auto populate it into columns D and E in sheet 2.


I don't have a basic understanding of spreadsheets, let alone these formulae and I am unable to follow the formulae instructions. Help?!

MacBook Pro, macOS Mojave (10.14), Numbers 5.2

Posted on Oct 5, 2018 6:51 AM

Reply
6 replies

Oct 6, 2018 6:54 AM in response to dm1054

Hi dm,

I have used an Automator sequence to download the data from the weblink and then I open it in Numbers and the manually split it into columns

I followed your link, and selected and copied just a few rows to test.

User uploaded file

Clicking on a blank part of the canvas in Numbers 5.2 and pasting, I see what you see.

User uploaded file

Numbers 5.2 recognises semicolons (;) as column separators without the need for Automator or manually separating into columns. But that is by the way. In Numbers, a new table!


Ahaa! Your information provider is giving you a "presentation" and not a workable database!

We can fix that with a little (tedious) editing.

Click on any cell in Column A, hold down the option key and press the left arrow key on the keyboard to insert a new column to the left.


Triple click on that redundant cell B3 to select all the text and Menu > Edit > Cut (command x)

User uploaded file

Triple click on the table name to select all the text and Menu > Edit > Paste (command v).

That removes one unnecessary row (Row 3).

User uploaded file

Type "Fund" without the quotes into cell A1.

Now cut each major heading (actually the Fund) in Scheme Code column B and paste into the relevant rows of column A

User uploaded file

Yes, tedious, but blame your information provider 👿.


Now sort the table (I suggest sort by column A) to bring all the blank rows together so that you can delete them all at once. Sorting by Date won't work because they are currently Text values and won't sort correctly.

User uploaded file


Sorry for the long explanation, but that should turn your table from a "presentation" into a workable, searchable data set.


Regards,

Ian.

Oct 6, 2018 4:36 AM in response to dm1054

Hi dm,


Quick question. Have you created the table NAV DATA yourself, and added the blank rows, or is that how the data arrives from your information supplier?


The reason I ask is that there are much simpler and more flexible ways of arranging the data. For example, this would be more powerful: making it easier to fill formulas down, sort the table, and create subtotals.

User uploaded file

I shortened your descriptions to save my typing.


Regards,

Ian.

Oct 6, 2018 10:45 AM in response to dm1054

Here's a way that's not fully automatic, but not too tedious either. You will notice a slow response from Numbers on some of the steps because your data table is so large.


1. Copy-paste the script below into Script Editor (in Applications > Utilities).

2. Make sure Script Editor.app is listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.

3. Click the triangle 'run' button in Script Editor. This will place the data on the system clipboard.

4. In Numbers click cell A1 of your NAV DATA table, and command-v to paste.

Click 'Adjust Settings' when this pops up in the upper right:


User uploaded file


5. Deselect , and select ; so the 'Separate Values Using' looks like this:


User uploaded file


Your NAV DATA table should now look like this:


User uploaded file


6. Then in your Table 1 you can do something like this (following Ian's instructions on INDEX MATCH).


User uploaded file


The formula In B2, filled right and down:


=INDEX(NAV DATA::D,MATCH($A2,NAV DATA::$B,0))


You may find it easier to set the formula up if you have both tables on the same sheet as in my example. Also, this works when the region is set to United States and language to English. If you're in another region and the table 'Adjust Settings' isn't doing quite the right thing, then try temporarily setting the region and language for that Numbers document at File > Advanced > Language & Region in your menu.


SG



The script to copy-paste into Script Editor is this:


set theURL to "https://www.amfiindia.com/spages/NAVAll.txt?t=06102018050527"

set theSource to do shell script "curl -s " & quoted form of theURL

set the clipboard totheSource

return theSource

Oct 5, 2018 7:32 AM in response to dm1054

Hi dm,


Something to get you started while I and other users study your question.


My cheat sheet for INDEX and MATCH:

=INDEX(Column I want a return value from,

MATCH(My Lookup Value,

Column I want to Lookup against,

Enter “0″ ))


- See more at: http://www.randomwok.com/excel/how-to-use-index-match/#sthash.L2WFkFjw.dpuf


Written for Excel, but it works in Numbers.


Acknowledgement to SGIII for that link.


Regards,

Ian.


Edit: in Table 1 on Sheet 2, put ISIN, FUND etc into Row 1 (a Header Row with magical properties 😉).

Ian.

Oct 6, 2018 4:43 AM in response to Yellowbox

Hi Ian

Thanks for getting back.

The data has to be downloaded from websites. I use the data at this link and it opens as a semicolon separates text file.

https://www.amfiindia.com/spages/NAVAll.txt?t=06102018050527)

I have used an Automator sequence to download the data from the weblink and then I open it in Numbers and the manually split it into columns, so it’s tedious. Numbers does not have the capacity of Excel to run web queries to import data automatically as far as I know. I could use Excel but the formulae usage gets me down. If there is an easy way to automate this process, it would be great.

Using Index and Match in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.