Ingnore blanks

DHayes

Board Regular
Joined
Nov 12, 2014
Messages
244
Good day,
I have the below function and it works 100%. I have now discovered that when there is a blank cell in the lookup the formula does not work. I would appreciate if any one could help me with the formula to ignore when it comes across a blank.
Code:
=INDEX(Sheet6!$E$10:$F$90,MATCH(LOOKUP(3,1/SEARCH(Sheet6!$E$10:$E$90,A2),Sheet6!$E$10:$E$90),Sheet6!$E$10:$E$90,0),2)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
try

Code:
=INDEX(Sheet6!$F$10:$F$90,MATCH(LOOKUP(3,1/SEARCH(Sheet6!$E$10:$E$20,A2),Sheet6!$E$10:$E$20),Sheet6!$E$10:$E$20,0))
 
Upvote 0
Hi AlanY,
Sorry I did try that one before still does not work.
I have given an example below. Sheet 1 is what I would like to achieve. But if there are spaces between the data (Sheet 6) it returns NA#.
Sheet 1

Item - 1 (AA)2460
Item - 2 (BB)1334
Item - 3 (CC)1089
Item - 4 (DD)2
Item - 5 (EE)0

<tbody>
</tbody>

Sheet 6
Item - 12 460
Item - 21 334
Item - 31 089
Item - 42
Item - 50

<tbody>
</tbody>
 
Last edited:
Upvote 0
could you do the index/match like this instaed

=INDEX(Sheet6!$F$10:$F$22,MATCH(F1,Sheet6!$E$10:$E$22,0))
 
Upvote 0
Hi AlanY,
Sorry that does not work. The reason why there is a lookup in the array is because on sheet 1 there is additional information in the brackets and the formula ignores the bracket.
My problem is I can't get around the blank spaces. There is a reason for it as in the row where the blank is there is other data.
 
Upvote 0
Hi, if your example data is representative - here is an alternative you could try:

=VLOOKUP(LEFT(A2,FIND(" (",A2&" (")-1),Sheet6!$E$10:$F$90,2,0)
 
Last edited:
Upvote 0
Hi FormR,
Thank you for your input it works. I have have adapted to index. I think I was over complicating it.
=INDEX(Sheet4!$E$2:$F$58,MATCH((LEFT(A2,FIND("(",A2&" (")-2)),Sheet4!$E$2:$E$58,0),2)
 
Upvote 0
Hi FormR,
Thank you for your input it works. I have have adapted to index. I think I was over complicating it.
=INDEX(Sheet4!$E$2:$F$58,MATCH((LEFT(A2,FIND("(",A2&" (")-2)),Sheet4!$E$2:$E$58,0),2)

only just realised what are you after, glad that you got it working
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,785
Members
449,095
Latest member
m_smith_solihull

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