+ Reply to Thread
Results 1 to 7 of 7

Drag formula Vlookup question?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Drag formula Vlookup question?

    Hello,

    I am wondering is there any way to do some changes with cell drag? So I will try to explain with example what I mean:

    Vlookup contains: [lookup_value;table_array;col_index_num;range_lookup] and the formula change only "table_arrey" /in the next cell/ when I use cell drag. Can I change this drag options and when I use cell drag to change only "col_index_num"?


    Thank you in advance!

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Drag formula Vlookup question?

    yes, for [column index number] put row(1:1) if you want it to increase by one as you drag down, or column(A:A) to increase by one as you drag across. If you want the start value to be more than one - adjust the 1:1 or A:A accordingly.

    hth
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    03-21-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Drag formula Vlookup question?

    I am doing something wrong, am I? Because I did not succeed
    For Example: vlookup[1;A3:E5;3;FALSE] and after drag row-down: vlookup[1;A4:E6;3;FALSE], or after drag column-right: vlookup[1;B3:F5;3;FALSE]
    But I want: vlookup[2;A3:E5;3;FALSE] and vlookup[1;A3:E5;4;FALSE]

    Where I have to put this "A:A" and "1:1"?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Drag formula Vlookup question?

    Okay, you don't want the cell references of the table to change, so make that $A$3:$E$5 in your formula. It is not clear if you want to copy down or across, but I suspect that you want this in your first cell:

    =VLOOKUP(ROWS($1:1);$A$3:$E$5;COLUMNS($A:C);FALSE)

    and then you can copy across and down.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    03-21-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Drag formula Vlookup question?

    Quote Originally Posted by Pete_UK View Post
    Okay, you don't want the cell references of the table to change, so make that $A$3:$E$5 in your formula. It is not clear if you want to copy down or across, but I suspect that you want this in your first cell:

    =VLOOKUP(ROWS($1:1);$A$3:$E$5;COLUMNS($A:C);FALSE)

    and then you can copy across and down.

    Hope this helps.

    Pete
    Thanks a lot! Sorry for delayed answer. I know for $A$3:$E$5 and now I try the other changes

  6. #6
    Registered User
    Join Date
    03-21-2013
    Location
    Stara Zagora, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Drag formula Vlookup question?

    You are great man!!!

    Thanks Pete_UK! It works NICE! I will buy you a beer.

    Have nice day!

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Drag formula Vlookup question?

    You can use the $ symbol to fix the cell references for table_array so that they do not change when you drag the formula.

    To change the col_index_num you would use a formula instead of a fixed number, for example, suppose you have this in B2:

    =VLOOKUP($A2,Sheet2!$A$1:$H$100,COLUMN(B$1),FALSE)

    The term COLUMN(B$1) will return 2, but if you drag that formula across then the term will change to COLUMN(C$1) (and return 3), then COLUMN(D$1), and so on. It will not change when you drag it down. Note also the $ symbol in front of the A for the lookup_value, so that you will always take this from column A.

    Hope this helps.

    Pete

+ Reply to Thread

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.6.0 RC 1