+ Reply to Thread
Results 1 to 8 of 8

Lookup - drag values

  1. #1
    Registered User
    Join Date
    11-25-2021
    Location
    Somerset
    MS-Off Ver
    O365
    Posts
    15

    Lookup - drag values

    Good Afternoon,

    I am using Excel 365 and have the following formula that I wish to drag so that the column numbers increase. However, I cannot get this to work without manually changing the formula. Can anyone help or advise on a revised formula please? I have trawled the forum for an hour and probably just confused myself



    =VLOOKUP($C$6,Combined!$A:$GH,2,0)
    Last edited by Dtromdtrom; 03-31-2023 at 10:34 AM.

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

    Re: Lookup - drag values

    Gonna need a little more info than that... Which way are you dragging it? Right or down?
    Which bit should increase as you drag? The reference to C6, the reference to column C, the reference to row 6 or the column number (2)?

    BSB

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,504

    Re: Lookup - drag values

    maybe this will help if you write the value like this... $C$6 that locks in cell c6 and regardless of which way, up down right left the formula will stay locked on C6.
    if you do C$6 then it locks in row 6 but when you drag it right it will index to D$6 then E$6 etc and B$6 if you drag it left but will stay on 6 as you drag up or down.
    if you do $C6 then it locks on column C but will move to row 5 or 4 or 7 or 8 when you drag up or down and of course C6 will advance or decrease in any direction you drag the formula. The same rule applies to whole columns except since you are not naming a row it only applies to the column. Hope that helps you.

    Oh and BTW, in a vlookup statement like ... =VLOOKUP($C$6,Combined!$A:$GH,2,0), the 2 after the $A:$GH means that it will ONLY look at the information in column C so all the remainder of the columns out to GH are wasted since the 2 limits it to looking only down column C.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    11-25-2021
    Location
    Somerset
    MS-Off Ver
    O365
    Posts
    15

    Re: Lookup - drag values

    Quote Originally Posted by BadlySpelledBuoy View Post
    Gonna need a little more info than that... Which way are you dragging it? Right or down?
    Which bit should increase as you drag? The reference to C6, the reference to column C, the reference to row 6 or the column number (2)?

    BSB
    Hi thanks for helping. I am looking to drag it right. It is the column number I want to increase. Any ideas on a formula I could drag right? Thanks.

  5. #5
    Registered User
    Join Date
    11-25-2021
    Location
    Somerset
    MS-Off Ver
    O365
    Posts
    15

    Re: Lookup - drag values

    Quote Originally Posted by Sam Capricci View Post
    maybe this will help if you write the value like this... $C$6 that locks in cell c6 and regardless of which way, up down right left the formula will stay locked on C6.
    if you do C$6 then it locks in row 6 but when you drag it right it will index to D$6 then E$6 etc and B$6 if you drag it left but will stay on 6 as you drag up or down.
    if you do $C6 then it locks on column C but will move to row 5 or 4 or 7 or 8 when you drag up or down and of course C6 will advance or decrease in any direction you drag the formula. The same rule applies to whole columns except since you are not naming a row it only applies to the column. Hope that helps you.

    Oh and BTW, in a vlookup statement like ... =VLOOKUP($C$6,Combined!$A:$GH,2,0), the 2 after the $A:$GH means that it will ONLY look at the information in column C so all the remainder of the columns out to GH are wasted since the 2 limits it to looking only down column C.
    Sorry I don't quite understand. It is the column number I want to change when I drag right...

  6. #6
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: Lookup - drag values

    If you write the following formula in a cell in column B you will get the number of that column, which is 2:
    Please Login or Register  to view this content.
    If the cell where the VLOOKUP formula is placed is, say, F3, you could adapt that to obtain the number 2 for your first VLOOKUP formula.
    Since column F is column number 6, for the first VLOOKUP formula you would type COLUMN()-4 to obtain the desired "2" in your initial formula.
    Then when you drag to the column next to it, the G column number will be 7, minus 4, it will be 3. Etc.

    So you could change your formula to something like this (assuming your formula is in column F):
    Please Login or Register  to view this content.
    Last edited by Mrrrr; 03-31-2023 at 01:05 PM. Reason: lol, made corrections since my math was bad :)
    To show your appreciation
    Click ★ Add reputation!

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,074

    Re: Lookup - drag values

    Please attach a sample workbook to show what you want to achieve.

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,504

    Re: Lookup - drag values

    which column are you looking to change, the vlookup for C6 or the A:GH or the reference value of 2?
    this would be one example of incorporating a changing column reference into your formula ...=VLOOKUP($C$6,Combined!$A:$GH,COLUMN(B1),0)
    that way it will look initially at column C but when dragged right it will next index to D then E etc. Is that what you are wanting?
    if not please indicate which column you are looking to index, and a sample workbook with some expected results would be helpful.

+ 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. Importrange, lookup and drag to autopopulate - Can we use this in one formula?
    By RMuller22 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 08-16-2022, 02:34 AM
  2. Replies: 0
    Last Post: 08-15-2022, 04:32 PM
  3. Replies: 3
    Last Post: 10-01-2019, 02:05 AM
  4. Multiple pictures lookup formula to drag down
    By Estevaoba in forum Excel General
    Replies: 3
    Last Post: 02-19-2019, 09:46 AM
  5. [SOLVED] drag values down diagnols
    By ammartino44 in forum Excel General
    Replies: 6
    Last Post: 09-30-2015, 12:49 PM
  6. Replies: 1
    Last Post: 05-04-2015, 12:14 PM
  7. Drag values down cells
    By mohd21uk via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-07-2006, 03:10 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