ISERROR in nested INDEX formula result NA#

Vbapadawan

New Member
Joined
Jul 5, 2015
Messages
13
I'm lost,:eek: I cannot find how to get the cell to display BLANK instead of NA# with the following code... Please help oh master of the Excel
Code:
=IF(ISERROR(INDEX(List1, MATCH(0, COUNTIF($B$5:B23, List1), 0))), INDEX(List2, MATCH(0, COUNTIF($B$5:B23, List2), 0)), INDEX(List1, MATCH(0, COUNTIF($B$5:B23, List1), 0)))
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try this
=IF(ISERROR(INDEX(List1,MATCH(0,COUNTIF($B$5:B25,List1),0))),INDEX(List2,MATCH(0,COUNTIF($B$5:B25,List2),0)),INDEX(List1,MATCH(0,COUNTIF($B$5:B25,List1))))

Are List1 and List2 named range or just value?
If these are value, you have to put like "List1".
 
Upvote 0
Sorry for the confusion Takae,

List1 (E8:E31) and List2 (F8:F31) are named ranges.
The formula looks at two columns of text on one worksheet and returns the unique value(s) to a range in another worksheet (B5:B25)

(
Try this
=IF(ISERROR(INDEX(List1,MATCH(0,COUNTIF($B$5:B25,List1),0))),INDEX(List2,MATCH(0,COUNTIF($B$5:B25,List2),0)),INDEX(List1,MATCH(0,COUNTIF($B$5:B25,List1))))

Are List1 and List2 named range or just value?
If these are value, you have to put like "List1".
 
Upvote 0
nope that failed.....

Sorry for the confusion Takae,

List1 (E8:E31) and List2 (F8:F31) are named ranges.
The formula looks at two columns of text on one worksheet and returns the unique value(s) to a range in another worksheet (B5:B25)

(
 
Upvote 0
found it for those looking...Since you're actually checking two lists, you'll want to do 2 error checks

Code:
=IF(ISERROR(INDEX(List1, MATCH(0, COUNTIF($B$5:B5, List1), 0))),
 IF(ISERROR(INDEX(List2, MATCH(0, COUNTIF($B$5:B5, List2), 0))),"",INDEX(List2, MATCH(0, COUNTIF($B$5:B5, List2), 0))),
INDEX(List1, MATCH(0, COUNTIF($B$5:B5, List1), 0)))
 
Upvote 0
Add the following code to your workbook, using Alt+F11...

Function ArrayUnion(ParamArray Arg() As Variant) As Variant
' Code: Juan Pablo González
' Spec: Aladin Akyurek
' May 4, 2003
' Ref: TinyURL.com - shorten that long URL into a tiny URL
Dim TempUnion() As Variant
Dim i As Long, Itm As Variant, Ctr As Long
For i = LBound(Arg) To UBound(Arg)
Arg(i) = Arg(i)
If IsArray(Arg(i)) Then
For Each Itm In Arg(i)
Ctr = Ctr + 1
ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Itm
Next Itm
Else
Ctr = Ctr + 1
ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Arg(i)
End If
Next i
ArrayUnion = TempUnion
End Function

Define Data in Name Manager as referring to:
Rich (BB code):

=arrayunion(List1,List2)

Note. You already have List1 and List2.

Define Ivec in Name Manager as referring to:
Rich (BB code):

=ROW(INDIRECT("1:"&COLUMNS(Data)))

In B3 control+shift+enter, not just enter:
Rich (BB code):

=SUM(IF(FREQUENCY(IF(Data<>"",
  MATCH("~"&Data,Data&"",0)),Ivec),1))

In B4 enter: Unique list

In B5 control+shift+enter, not just enter, and copy down:
Rich (BB code):

=IF(ROWS($B$5:B5)<=$B$3,
  INDEX(Data,SMALL(IF(FREQUENCY(IF(Data<>"",
  MATCH("~"&Data,Data&"",0)),Ivec),Ivec),ROWS($B$5:B5))),"")
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,413
Members
449,449
Latest member
Quiet_Nectarine_

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