+ Reply to Thread
Results 1 to 5 of 5

Error in Vlookup string: A value used in the formula is of the wrong data type.

  1. #1
    Registered User
    Join Date
    02-17-2016
    Location
    Cambridgeshire, UK
    MS-Off Ver
    2010
    Posts
    2

    Error in Vlookup string: A value used in the formula is of the wrong data type.

    Hi, I've been using excel for years, but have just started to expand what I do with it, so any help on my problem will be gratefully received.

    As the title says, I am having a problem with Vlookup. The formula I have is: =VLOOKUP(VALUE(MID(B2,1,4))*NewMod!$A$2:$B$793,2,0)
    All cells are formatted as general
    Cell B2 contains a 9 digit number
    All cells in column $A contain a 4 digit number
    All cells in column $B contain a plain text string

    I did originally have the cells in the columns containing numbers formatted as numbers and the ones containing text formatted as text, but still had the same error.

    Thanks in advance

    Ian
    Last edited by Taylorim; 02-17-2016 at 07:21 AM. Reason: Text error

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Error in Vlookup string: A value used in the formula is of the wrong data type.

    This works OK for me

    =VLOOKUP(VALUE(MID(B2,1,4)),NewMod!$A$2:$B$793,2,0)

    B2 is text string "123456789" or numeric

    A2 is numeric 1234
    Last edited by JohnTopley; 02-17-2016 at 07:31 AM.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Error in Vlookup string: A value used in the formula is of the wrong data type.

    Quote Originally Posted by Taylorim View Post
    =VLOOKUP(VALUE(MID(B2,1,4))*NewMod!$A$2:$B$793,2,0)
    Here's another way to write that formula:

    =VLOOKUP(--LEFT(B2,4),NewMod!$A$2:$B$793,2,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    02-17-2016
    Location
    Cambridgeshire, UK
    MS-Off Ver
    2010
    Posts
    2

    Re: Error in Vlookup string: A value used in the formula is of the wrong data type.

    Thank you for the prompt responses and for solving my problem.

    Ian

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Error in Vlookup string: A value used in the formula is of the wrong data type.

    You're welcome. We appreciate the feedback!

+ 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. [SOLVED] Wrong data type error message
    By Ian Jemmett in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2014, 05:13 AM
  2. [SOLVED] Wrong Data Type Value Are for formula involving Dates
    By heresteve2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2014, 12:38 PM
  3. Value used in formula of wrong data type
    By masry6683 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2014, 10:55 AM
  4. SUMIFS Problem - A value used in the formula is of the wrong data type
    By TicklyTigger in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-09-2014, 10:48 AM
  5. Replies: 4
    Last Post: 04-20-2012, 08:44 AM
  6. wrong data type #VALUE! error
    By osteolass in forum Excel General
    Replies: 3
    Last Post: 06-20-2011, 07:02 PM
  7. Formula returns wrong data type
    By mbrown89 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 01-30-2010, 12:36 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