Ignore Index Variable

akstiffney

New Member
Joined
Oct 29, 2018
Messages
3
Hello, I have an excel sheet that uses an INDEX function with multiple criteria reference inputs and the function looks through a table of data and returns the rows that match the criteria inputs. I want to be able to ignore certain criteria if i want. I didn't know if a certain value could be entered into the reference inputs that would make the INDEX function ignore that variable. I hope that makes sense. I attached my formula below.

=IFERROR(INDEX('Total Data'!$A$9:$A$4581, SMALL(IF(1=((--('User Interface'!$B$13='Total Data'!$AD$9:$AD$4581))*(--('User Interface'!$B$7='Total Data'!$X$9:$X$4581))*(--('User Interface'!$B$10='Total Data'!$Z$9:$Z$4581))), ROW('Total Data'!$A$9:$A$4581)-8,""), ROW()-26)),"")
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi
Welcome to the board

Let's say that you use the string "NA" to ignore criteria (choose another code if you have values equal to "NA").

To ignore the first criterion write "NA" in 'User Interface'!$B$13 and replace

(--('User Interface'!$B$13='Total Data'!$AD$9:$AD$4581))

with

(('User Interface'!$B$13='Total Data'!$AD$9:$AD$4581)+('User Interface'!$B$13="NA"))

Same for the other criteria.
 
Upvote 0
Thanks for the reply! I made the change you suggested. Now, if all the criteria are "NA" all of the data is returned by the INDEX function, which makes sense, but once I include a criteria the INDEX function returns no data.
If you have a fix for it let me know. Below is my new equation.

=IFERROR(INDEX('Total Data'!$A$9:$A$4581, SMALL(IF(1=((('User Interface'!$B$13='Total Data'!$AD$9:$AD$4581)+('User Interface'!$B$13="NA"))*(('User Interface'!$B$7='Total Data'!$AD$9:$AD$4581)+('User Interface'!$B$7="NA"))*(('User Interface'!$B$10='Total Data'!$AD$9:$AD$4581)+('User Interface'!$B$10="NA"))), ROW('Total Data'!$A$9:$A$4581)-8,""), ROW()-26)),"")
 
Upvote 0
Hi

In this last formula you are just using column AD.

In your first post you use AD, X and Z.

Please check.
 
Upvote 0

Forum statistics

Threads
1,224,942
Messages
6,181,899
Members
453,068
Latest member
DCD1872

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