#NUM Error Using Search Formula

ir121973

Active Member
Joined
Feb 9, 2008
Messages
371
Hi, I wonder whether someone may be able to help me please.

From this site Lookup with multiple criteria and display multiple search results using excel formula, part 4 | Get Digital Help - Microsoft Excel resource I've put together this formula, which works as expected:

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> [FONT=&quot]=SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26))[/FONT]

The problem I'm having is where there is no data to return, if this is the case then the cell read #NUM!. I understand why thbis happens but I'm not sure how to overcome it.

Could somene perhaps offer a little guidance please, so instead of the cell showing the #NUM error, the cell is blank.

<!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->
Many thanks and kind regards
 
Something along the lines of

=if(iserror(SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26)),"",SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26)))
 
Upvote 0
Hi, I wonder whether someone may be able to help me please.

From this site Lookup with multiple criteria and display multiple search results using excel formula, part 4 | Get Digital Help - Microsoft Excel resource I've put together this formula, which works as expected:

=SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26))

The problem I'm having is where there is no data to return, if this is the case then the cell read #NUM!. I understand why thbis happens but I'm not sure how to overcome it.

Could somene perhaps offer a little guidance please, so instead of the cell showing the #NUM error, the cell is blank.
The way to do what you want depends on the version of Excel your formula will be used on...

Excel 2007 and above...
------------------------------------------------
=IFERROR(SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26)),"")

Excel 2003 (maybe earlier - don't have, can't test) and above....
--------------------------------------------------------------------------------------------------
=IF(ISERROR(SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26))),"",SMALL(IF(ISNUMBER(SEARCH(Search_customer, Customer)*SEARCH(Search_cust_name, Cust_Name)*SEARCH(Search_Appt_date, Appt_date)*SEARCH(Search_Appt_time, Appt_time)*SEARCH(Search_venue, Venue)*SEARCH(Search_Coordinator, Coordinator)*SEARCH(Search_Assistant, Assistant)), ROW(Customer)-MIN(ROW(Customer))+1), ROWS(B$24:$B26)))
 
Upvote 0
Hi @Rick Rothstein, thank you very much for taking the time to reply to my post and for the solution.

My apologies, I should have said which version of Excel I was using, it is in fact 2003. But you solution is exactly what I was after!

Once again many thanks and kind regards
 
Upvote 0
Hi @steve059L, thank you for taking the time to reply to my post and for the solution.

As was the case with @Rick Rothstein, your solutioin worked great.

Thank you and kind regards
 
Upvote 0

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