+ Reply to Thread
Results 1 to 7 of 7

VALUE OFFSET function not working as expected

  1. #1
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    209

    VALUE OFFSET function not working as expected

    Hello All,

    I am using below function to convert my value to number and I am using it in my Index and Match function.

    IF(ISNUMBER(VALUE(OFFSET(L8,0,-2))),VALUE(OFFSET(L8,0,-2)),OFFSET(L8,0,-2)

    If my L8 is '00035', the the above code returns 35 instead of '00035'.

    It s evaluating the ISNUMBER to TRUE and returning the value of VALUE(OFFSET(L8,0,-2)) which is 35 instead of OFFSET(L8,0,-2) which is '00035'.

    This function works for text values and number values. But, it is not working for numbers with leading 0s.

    Please suggest how can we retain the value as 00035 without changing the logic for other numbers or text values.

    Thanks in advance.

  2. #2
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: VALUE OFFSET function not working as expected

    could SUBSTITUTE() be help ?

    Regards.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: VALUE OFFSET function not working as expected

    Real numbers dont actually have leading zeros, it's just how excel might display them if you format them to show that way.

    if you have something that IS act35 in a cell, then that is text, not numeric

    Provide a sample file so we can see what you are working with in context please.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    209

    Re: VALUE OFFSET function not working as expected

    Thanks for the update.

    Attach the excel. I am looking to have number in the same format as given which is '00035'
    Attached Files Attached Files

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: VALUE OFFSET function not working as expected

    Try this...
    =INDEX(CoCo!A:A,MATCH(lookup!A2,CoCo!B:B,0))

  6. #6
    Forum Contributor
    Join Date
    07-04-2018
    Location
    Dallas
    MS-Off Ver
    MS 365 Version 2302
    Posts
    209

    Re: VALUE OFFSET function not working as expected

    Thanks.

    Not sure if I am doing anything wrong. Lookup doesn't seem to be working for me when I try in a different excel.
    Attach the file.
    Attached Files Attached Files

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: VALUE OFFSET function not working as expected

    1. I did not use LOOKUP, your sheet name was lookup, so I referenced the sheet name.

    2. Your reference in your 2nd file looks nothing like the formula I showed you
    your reference...
    =lookup!C2
    my formula
    =INDEX(CoCo!A:A,MATCH(lookup!A2,CoCo!B:B,0))

    3. Your 2nd file contains only 2 numbers and 2 references, and is nothing like your 2st file that actually had some data in it.
    (so pretty much, you did everything wrong lol)

+ 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] Choose function not working as expected
    By winfs in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-16-2021, 03:51 AM
  2. [SOLVED] IF function not working as expected
    By anande in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-30-2019, 12:29 AM
  3. [SOLVED] Concatenate function not working as expected
    By katiedee1625 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-07-2018, 03:48 PM
  4. Replies: 3
    Last Post: 07-29-2017, 04:32 AM
  5. Aggregate Function Not Working As Expected
    By tjnelso in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-06-2016, 04:55 PM
  6. [SOLVED] worksheets function not working as expected
    By elmasguapo in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-15-2015, 05:18 AM
  7. [SOLVED] Hyperlink Function not working as expected
    By Hari Prasadh in forum Excel General
    Replies: 2
    Last Post: 04-16-2005, 09:08 AM

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