Solved

Excel -- Index Match array giving incorrect result

Posted on 2015-01-22
9
70 Views
Last Modified: 2015-02-24
Greetings,

I have a formula that is intended to retrieve a list of IP addresses from a sheet named ip. The ip sheet stores the ip addresses in the second column (B). Whenever I enter the name of the server into A2 on the lookup sheet it gives me the IP address that falls one cell below the intended result.

=IF(ISERROR(INDEX(ip!$A$2:$B$241,SMALL(IF(ip!$A$1:$A$241=$A$2,ROW(ip!$A$2:$A$242)),ROW(1:1)),2)),"",INDEX(ip!$A$2:$B$236,SMALL(IF(ip!$A$2:$A$242=$A$2,ROW(ip!$A$2:$A$242)),ROW(1:1)),2))

Open in new window


If you have any questions let me know.

NeptuneIT
0
Comment
Question by:neptuneit
9 Comments
 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 40564414
Diffcult to say, without seeing the worksheet.

but in the meanwhile, can you try

=IF(ISERROR(INDEX(ip!$A$2:$B$241,SMALL(IF(ip!$A$1:$A$241=$A$2,ROWS(ip!$A$2:$A$242)),ROW(1:1)),2)),"",INDEX(ip!$A$2:$B$236,SMALL(IF(ip!$A$2:$A$242=$A$2,ROWS(ip!$A$2:$A$242)),ROW(1:1)),2))
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40564537
I believe you need to adjust all of the ranges referred to from the ip sheet to starting at the same row, ie ip!$A$2, you have some starting at ip!$A$1.

I don't think the finishing rows being different is an issue in this case but worth changing those to the same as well.

Thanks
Rob H
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40564549
As an aside, you can probably shrink the formula using IFERROR(..) rather than IF(ISERROR(..)).

Syntax:

=IFERROR(Formula,ErrorResult)

In your case, (I have adjusted for all same ranges as mentioned above, but check the brackets!!):

=IFERROR(INDEX(ip!$A$2:$B$242,SMALL(IF(ip!$A$2:$A$242=$A$2,ROWS(ip!$A$2:$A$242)),ROW(1:1)),2)),"")

Thanks
Rob H
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:neptuneit
ID: 40564590
ip!$A$1 is the header, is it still required?
0
 
LVL 1

Author Comment

by:neptuneit
ID: 40564620
Also Rob, changing the $A$2 to $A$1 generates an empty result
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40564641
I was suggesting the other way, make all ranges start at A2.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 40564778
>=IFERROR(INDEX(ip!$A$2:$B$242,SMALL(IF(ip!$A$2:$A$242=$A$2,ROWS(ip!$A$2:$A$242)),ROW(1:1)),2)),"")

You can't have ROWS in that part, Rob

Try this version, assuming you enter the formula in D2 and copy down

=IFERROR(INDEX(ip!$A$2:$B$242,SMALL(IF(ip!$A$2:$A$242=$A$2,ROW(ip!$A$2:$A$242)-ROW(ip!$A$2)+1),ROWS(D$2:D2)),2),"")

confirmed with CTRL+SHIFT+ENTER

regards, barry
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40628866
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question