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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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

[TABLE="width: 416"]
<tbody>[TR]
[TD="align: left"]Item - 1 (AA)[/TD]
[TD="align: right"]2460[/TD]
[/TR]
[TR]
[TD="align: left"]Item - 2 (BB)[/TD]
[TD="align: right"]1334[/TD]
[/TR]
[TR]
[TD="align: left"]Item - 3 (CC)[/TD]
[TD="align: right"]1089[/TD]
[/TR]
[TR]
[TD="align: left"]Item - 4 (DD)[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: left"]Item - 5 (EE)[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]

Sheet 6[TABLE="width: 283"]
<tbody>[TR]
[TD="align: left"]Item - 1[/TD]
[TD="align: right"]2 460[/TD]
[/TR]
[TR]
[TD="align: left"]Item - 2[/TD]
[TD="align: right"]1 334[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]Item - 3[/TD]
[TD="align: right"]1 089[/TD]
[/TR]
[TR]
[TD="align: left"]Item - 4[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]Item - 5[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]
 
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,224,941
Messages
6,181,894
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