+ Reply to Thread
Results 1 to 4 of 4

The last number of the column, vlookup and offset code

  1. #1
    Forum Contributor
    Join Date
    06-20-2016
    Location
    Los Angeles/Thailand
    MS-Off Ver
    2016
    Posts
    250

    The last number of the column, vlookup and offset code

    Hello, I'm using this vlookup offset code to find out which is the last number of the column.

    =OFFSET(INDEX(O2:W2,MATCH(A2,O2:W2,0)),COUNT(O:O),0,1)

    The code works, but instead of giving me the last number it gives me the number before the last. What am I doing wrong?

    Name of the column is #E - Difference from.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: The last number of the column, vlookup and offset code

    The COUNT part of the formula is returning 1 less than you think it is as there's no numeric value in cell O3.

    If that is to remain blank then COUNT(O:O)+1 will work.

    BSB

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,891

    Re: The last number of the column, vlookup and offset code

    Quote Originally Posted by sovietchild View Post
    What am I doing wrong?
    because O3 is empty, try this:

    =LOOKUP(10^35,OFFSET(N:N,,MATCH(A2,$O$2:$X$2,0)))

  4. #4
    Forum Contributor
    Join Date
    06-20-2016
    Location
    Los Angeles/Thailand
    MS-Off Ver
    2016
    Posts
    250

    Re: The last number of the column, vlookup and offset code

    Thanks for the replies.

    This code =LOOKUP(10^35,OFFSET(N:N,,MATCH(A2,$O$2:$X$2,0))) worked!

+ 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] VBA code, Named range as Rowsource need to offset -1 column
    By Amita68 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2017, 05:19 PM
  2. [SOLVED] identify specific cells in column possibly using count, offset, vlookup
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-14-2017, 12:49 PM
  3. [SOLVED] Designing a Macro code for new column with some new offset
    By Haidar123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2014, 06:36 PM
  4. Code for VBA VLookup result blank if column index number is blank
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2014, 05:55 PM
  5. Replies: 10
    Last Post: 10-04-2012, 02:11 AM
  6. Hard code column number in OFFSET formula
    By maacmaac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2010, 04:13 PM
  7. Can Column Offset in VB code be told to go to column A?
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2009, 03:05 PM

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