Index Match How to avoid blank cells

lwilt

Board Regular
Joined
May 16, 2013
Messages
187
Hi,


I'm trying to use an index match and the column where I'm trying to return data has blank cells in it. The formula I tried but didn't work was:


=INDEX(F2:F2000,IF(F2:F2000<>"",MATCH,A1,A2:A2000,0)))


The problem I'm running into is that the data I'm trying to return on an entry occurs after a blank and that entire entry is skipped. Below is an example so you can see what's causing my issue.


order A return data
order A blank
order B blank
order B return data
order B return data


So order A will allow to me return the information I'm trying to grab for that order but on B because it's first cell is blank all of order B is skipped and I can't return that piece of data I'm trying to get.


thanks for the help.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
@lwilt, see if this does what you need:

=INDEX($F$2:$F$2000,(SUMPRODUCT(--($A$2:$A$2000=A1)*($F$2:F$2000<>"")*ROW($F$2:$F$2000))-1))
 
Upvote 0
I'll give it a try. I've also posted a sample workbook on the other two sites with the links posted since I can't figure out how to attach a doc in this thread.
 
Upvote 0
@lwilt, could you let us (and future readers) know which solution/formula solved the issue, particularly given that this was cross-posted?
 
Upvote 0
Sure can. I ended up using:

=IFERROR(INDEX(Sheet2!$F$2:$F$15,SMALL(IF((Sheet2!$A$2:$A$15=Sheet1!$C2)*(Sheet2!$F$2:$F$15<>""),ROW($F$2:$F$15)-ROW($F$2)+1),1)),"")

and activating the array with the curly brackets around it.

I saw a few other posts had shorter formulas so I'm going to try those out later today but I do know the one above worked.
 
Upvote 0

Forum statistics

Threads
1,213,565
Messages
6,114,338
Members
448,569
Latest member
Honeymonster123

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