+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    01-29-2009
    Location
    Houston
    MS-Off Ver
    Excel 2003
    Posts
    39

    IF(ISNumber) Question

    See attached file...I'm having trouble returning a value for the Alpha-numberics that begin with DMR, which should return 'Dishwasher'. All other values are correct, I'm sure it has to do with the character range but I'm a little stumped.
    Attached Files Attached Files
    Last edited by mikera; 01-28-2010 at 04:05 PM.

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225

    Re: IF(ISNumber) Question

    try this in B2, copy down:

    =VLOOKUP(IF(ISNUMBER(MID(A2,3,1)+0), LEFT(A2,2), LEFT(A2,3)), $D$2:$F$10, 3, 0)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,212

    Re: IF(ISNumber) Question

    Hi Mikera, change your formula to:

    =VLOOKUP(IF(ISNUMBER(MID(A2,3,1)+0),LEFT(A2,2),LEFT(A2,3)),$D$2:$F$10,3,FALSE)

    When you use the MID function it returns a text string, not a value. The text "3" is not equal to the number 3. I also moved the red 3 and two around to work properly.

  4. #4
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2003, 2007, 2010
    Posts
    3,605

    Re: IF(ISNumber) Question

    Using your posted workbook....try this:
    Code:
    B2: =VLOOKUP(LEFT(A2,3-ISNUMBER(--MID(A2,3,1))),$D$2:$F$10,3,FALSE)
    Copy that formula down through B10

    Notice that the MID function returns text....so the ISNUMBER(MID(something))
    construct will always be false. I used the dbl-minus to convert the MID value
    to a number (if possible)
    --"2" becomes 2
    --"M" becomes #VALUE!

    Dos that help?
    Last edited by Ron Coderre; 01-28-2010 at 03:16 PM.
    Regards,

    Ron
    Microsoft MVP - Excel
    (Oct 2006 - Sep 2012)

    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    01-29-2009
    Location
    Houston
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: IF(ISNumber) Question

    Both options worked, thanks.

Thread Information

Users Browsing this Thread

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

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.2.0