+ Reply to Thread
Results 1 to 6 of 6

getting #N/A error after using RIGHT SEARCH functions

  1. #1
    Registered User
    Join Date
    05-02-2005
    Posts
    67

    getting #N/A error after using RIGHT SEARCH functions

    I have attached a workbook that I am having challenges with and need some advise on how to resolve. You will notice that I have a report that was exported to excel. Since it does not have all the information that I need, I first used the RIGHT(B10,LEN(B10)-SEARCH("_c",B10)-1) in cell G10 to take the customer number out of the concatenated field (that had customer name and customer #). The result is correct but then I am then trying to use that cell to do a VLOOKUP to find the sales rep associated with that account in another source (TAB Name = Sales reps).

    Anytime I try to refer to that cell (h10, h11, h12), I get a #/NA message. The entry for sales rep # is in the Sales rep List. Does the RIGHT SEARCH function create some other data type? Any thoughts as to how to resolve?


    Thanks in advance for your help!

    Jim
    Attached Files Attached Files
    Last edited by jshrader; 11-28-2018 at 08:48 PM.

  2. #2
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: getting #N/A error after using RIGHT SEARCH functions

    In G10 add a unary minus (--) to your formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Otherwise you're comparing a number to text
    Last edited by GeoffW283; 11-28-2018 at 08:00 PM.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: getting #N/A error after using RIGHT SEARCH functions

    The RIGHT function will return a text value, although your customer number IDs are actually real numbers. You can overcome this by changing the formula in H10 to this:

    =VLOOKUP(G10+0,'Sales Reps'!$A$2:$B$7,2,FALSE)

    That +0 will change G10 to a numerical value, so the VLOOKUP will work correctly. Note that I have also anchored the range by using $ symbols, so you can copy this down without the range changing.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    05-02-2005
    Posts
    67

    Re: getting #N/A error after using RIGHT SEARCH functions

    Thank you Pete and Geoff. Both solutions worked! I appreciate your help!!

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: getting #N/A error after using RIGHT SEARCH functions

    Glad to hear that. Thanks for the rep.

    Pete

  6. #6
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: getting #N/A error after using RIGHT SEARCH functions

    Jim - glad to help and thanks also for the rep - I need the points more than Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search and IF functions
    By RpGroves in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-21-2017, 01:18 AM
  2. Search Range using IF AND Functions - #VALUE! error
    By swisha in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-24-2014, 11:57 AM
  3. Error handling in functions within other functions.
    By marlonsaveri in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-03-2011, 09:13 PM
  4. Using IF and SEARCH functions
    By visionwindowfilms in forum Excel General
    Replies: 2
    Last Post: 07-01-2010, 11:10 AM
  5. search functions
    By iain hamilton in forum Excel General
    Replies: 6
    Last Post: 04-21-2008, 05:18 PM
  6. search & if functions
    By sys-con in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-17-2007, 12:02 PM
  7. Need help using search functions
    By cburgess57 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2005, 05:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1