Index & Match to ignore blanks

TheBarman

New Member
Joined
Jun 10, 2009
Messages
16
Hi team, hoping you can help with the index,match formula to find the occurrence where the storage unit is not blank (or zero). The formula is referring to a table (called "Runners") in another sheet. The table is refreshed every hour throughout the day to bring in new data. Unfortunately there are more columns of data than the sample below, so I am unable to use a pivot table or vlookup and must be an INDEX.


Here is where I am up to with the formula:

=IF(INDEX(Runners[[#All],[Storage Unit]],MATCH(F2,Runners[[#All],[Name]],0))<>0,INDEX(Runners[[#All],[Location]],MATCH(F2,Runners[[#All],[Name]],0)),"Give me second occurance")

F2 refers to another sheet with Names


Sample of table:

[TABLE="width: 211"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Location[/TD]
[TD]Storage Unit[/TD]
[/TR]
[TR]
[TD]Michael[/TD]
[TD]Brisbane[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Peter[/TD]
[TD]Sydney[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Louise[/TD]
[TD]Melbourne[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Peter[/TD]
[TD]Perth[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Louise[/TD]
[TD]Adelaide[/TD]
[TD]9[/TD]
[/TR]
</tbody>[/TABLE]


Outcome:
Index Louise to find "Adelaide" because there is a value in the storage unit column [9] - not "Melbourne" because it's the first Match.
Index Peter to find "Perth" because there is a value in the storage unit column [5] - not "Sydney" because it's the first Match.



Appreciate your help.
Dave.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Maybe something like this:
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
If someone can have more than 1 Unit, drag the formula down as needed and it will return all locations.
Excel Workbook
ABC
1NameLocationStorage Unit
2MichaelBrisbane4
3PeterSydney
4LouiseMelbourne
5PeterPerth5
6LouiseAdelaide9
7
8
9NameLouise
10Location(s)Adelaide
11
12
Sheet
 
Upvote 0
Also, using the Table references...

Control+shift+enter, not just enter:

=INDEX(Runners[Storage Unit],MATCH(F2,IF(ISNUMBER(Runners[Storage Unit]),Runners[Name]),0))

where F2 = Louise.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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